luo
2023-12-25 23c4967b4cb8dbce8277f830f7152d315c5a4a57
guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
@@ -28,8 +28,7 @@
        left join t_app_user au on (hr.app_user_id = au.id)
        left join t_region rc on (hr.district_id = rc.id)
        left join t_region rp on (rp.id = rc.parent_id)
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        and hr.type=2
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2  and hr.type=2
        <if test="null != req.type">
            and hr.data_type = #{req.type}
        </if>
@@ -332,18 +331,18 @@
        WHEN hs.is_manage IS NULL AND ap.user_type = 3 THEN 3
        ELSE hs.is_manage
        END AS isManage,
        IFNULL(ap.nickname,su.`name`) as name, IFNULL(ap.phone,su.phone) as phone,
        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
        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.auth_status = 2
        where     hs.is_delete = 0 and hs.auth_status = 2  and hs.type = 2
        ) a
        <where>
            <if test="null != cellName and '' != cellName">
                and a.cell_name like CONCAT('%', #{cellName}, '%')
                and a.cellName like CONCAT('%', #{cellName}, '%')
            </if>
            <if test="null != dataType">
                and a.dataType = #{dataType}
@@ -375,14 +374,14 @@
        WHEN hs.is_manage IS NULL AND ap.user_type = 3 THEN 3
        ELSE hs.is_manage
        END AS isManage,
        IFNULL(ap.nickname,su.`name`) as name, IFNULL(ap.phone,su.phone) as phone,
        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
        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
        where     hs.is_delete = 0 and hs.type = 2
        order by hs.insert_time desc
        ) a
        <where>
@@ -414,7 +413,7 @@
    </select>
    <select id="reprotList" 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,
        SELECT hs.insert_time as insertTime, hr.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
@@ -423,7 +422,7 @@
        END AS isManage,
        IFNULL(ap.nickname,su.`name`) 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,hr.content,hr.audit,hr.back_reason as backReason,hr.back_date as backDate
        hs.house_area as houseArea , hs.status,hr.content,hr.audit,hr.back_reason as backReason,hr.back_date as backDate,hs.id as houseId
        from t_report_house_resource hr
        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