| | |
| | | LEFT JOIN t_app_user ap ON hs.insert_user_id = ap.id |
| | | LEFT JOIN sys_user su ON hs.insert_user_id = su.id AND hs.is_manage = 1 |
| | | where hs.is_delete = 0 and hs.auth_status = 2 and hs.type = 2 |
| | | |
| | | order by hs.insert_time desc |
| | | ) a |
| | | <where> |
| | | <if test="null != cellName and '' != cellName"> |
| | |
| | | |
| | | |
| | | <select id="aulist" resultType="com.stylefeng.guns.modular.system.dto.THouseResource"> |
| | | select * from ( |
| | | SELECT hs.insert_time as insertTime, hs.id, hs.cell_name as cellName, hs.house_address as houseAddress, |
| | | hs.data_type as dataType, |
| | | CASE |
| | | WHEN hs.is_manage IS NULL AND ap.user_type = 2 THEN 2 |
| | | WHEN hs.is_manage IS NULL AND ap.user_type = 3 THEN 3 |
| | | ELSE hs.is_manage |
| | | END AS isManage, |
| | | IFNULL(su.`name`,ap.nickname) as name, IFNULL(ap.phone,su.phone) as phone, |
| | | hs.house_model as houseModel, hs.building_orientation as buildingOrientation, hs.sale_amount as saleAmount, |
| | | hs.house_area as houseArea , hs.status,hs.auth_status AS authStatus |
| | | FROM t_house_resource hs |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | hs.insert_time AS insertTime, |
| | | hs.id, |
| | | hs.cell_name AS cellName, |
| | | hs.house_address AS houseAddress, |
| | | hs.data_type AS dataType, |
| | | hs.house_model AS houseModel, |
| | | hs.building_orientation AS buildingOrientation, |
| | | hs.sale_amount AS saleAmount, |
| | | hs.house_area AS houseArea, |
| | | hs.STATUS, |
| | | hs.auth_status AS authStatus, |
| | | ap.user_type as isManage, |
| | | ap.nickname as name, |
| | | ifnull(ap.phone1,ap.phone) as phone |
| | | FROM |
| | | t_house_resource hs |
| | | LEFT JOIN t_app_user ap ON hs.insert_user_id = ap.id |
| | | LEFT JOIN sys_user su ON hs.insert_user_id = su.id AND hs.is_manage = 1 |
| | | where hs.is_delete = 0 and hs.type = 2 |
| | | order by hs.insert_time desc |
| | | WHERE |
| | | hs.is_delete = 0 |
| | | AND hs.type = 2 and ISNULL(hs.is_manage) |
| | | ORDER BY |
| | | hs.insert_time DESC |
| | | ) a |
| | | <where> |
| | | |
| | | |
| | | <where> |
| | | <if test="null != id"> |
| | | and a.id = #{id} |
| | | </if> |
| | |
| | | LEFT JOIN t_house_resource hs on hr.house_resource_id = hs.id |
| | | LEFT JOIN t_app_user ap ON hs.insert_user_id = ap.id |
| | | LEFT JOIN sys_user su ON hs.insert_user_id = su.id AND hs.is_manage = 1 |
| | | where hs.is_delete = 0 and hs.auth_status = 2 |
| | | where hs.auth_status = 2 |
| | | |
| | | ) a |
| | | <where> |