linwe
2024-05-29 c10d6358b9f014375a13821465bc978d0c0da22e
src/main/java/org/springblade/modules/task/mapper/TaskPlaceSelfCheckMapper.xml
@@ -60,6 +60,7 @@
        LEFT JOIN blade_user bu ON bu.id = jpc.create_user and bu.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        <where>
            and jp.house_code is not null
            <if test="place.id != null ">and jpc.id = #{place.id}</if>
            <if test="place.taskId != null ">and jpc.task_id = #{place.taskId}</if>
            <if test="place.taskName != null  and place.taskName != ''">and jpc.task_name = #{place.taskName}</if>
@@ -79,7 +80,7 @@
            <if test="place.remark != null  and place.remark != ''">and jpc.remark = #{place.remark}</if>
            <if test="place.updateTime != null ">and jpc.update_time = #{place.updateTime}</if>
            <if test="place.createTime != null ">and jpc.create_time = #{place.createTime}</if>
            <if test="place.houseCode != null  and place.houseCode != ''">and jpc.house_code = #{place.houseCode}</if>
            <if test="place.type != null  and place.type != ''">and jpc.type = #{place.type}</if>
            <if test="place.rectificationEndTime != null ">and jpc.rectification_end_time =
                #{place.rectificationEndTime}
            </if>
@@ -111,6 +112,13 @@
            <if test="place.imageUrls != null  and place.imageUrls != ''">and jpc.image_urls = #{place.imageUrls}</if>
            <if test="place.status != null ">and jpc.status = #{place.status}</if>
            <if test="place.deleteFlag != null ">and jpc.delete_flag = #{place.deleteFlag}</if>
            <if test="place.startTime != null and place.startTime != ''">
                and date_format(jpc.create_time,'%Y-%m-%d') &gt;= #{place.startTime}
            </if>
            <if test="place.endTime != null and place.endTime != ''">
                and date_format(jpc.create_time,'%Y-%m-%d') &lt;= #{place.endTime}
            </if>
            <if test="isAdministrator==2">
                <choose>
                    <when test="place.roleName != null and place.roleName != ''">
@@ -165,6 +173,8 @@
                    </otherwise>
                </choose>
            </if>
            <if test="place.houseCode != null  and place.houseCode != ''"> and jpc.house_code = #{place.houseCode}</if>
        </where>
        order by jpc.create_time desc
    </select>
@@ -189,6 +199,7 @@
        <result property="imageUrls" column="image_urls"/>
        <result property="status" column="status"/>
        <result property="deleteFlag" column="delete_flag"/>
        <result property="type" column="type"/>
        <collection property="placePoiLabelVOList" column="jpid" javaType="java.util.List"
                    select="selectPlacePoiLabelList"
@@ -196,7 +207,7 @@
                    autoMapping="true">
        </collection>
        <collection property="taskPlaceRecordVOList" column="id" select="selectPatrolRecordList"
        <collection property="taskPlaceRecordVOList" column="{id=id,type=type}" select="selectPatrolRecordList"
                    javaType="java.util.List" ofType="org.springblade.modules.task.vo.TaskPlaceRecordVO"
                    autoMapping="true">
        </collection>
@@ -222,27 +233,31 @@
        </select>
    <select id="selectPatrolRecordList" parameterType="Long"
    <select id="selectPatrolRecordList"  parameterType="java.util.Map"
            resultType="org.springblade.modules.task.vo.TaskPlaceRecordVO">
            select
           jpr.id,
           jpr.item_id,
           jpr.task_place_self_check_id,
           jpr.state,
           jpr.remark,
           jpr.image_urls,
           jpr.create_user,
           jpr.create_time,
           jpr.is_deleted,
           jpr.rectification_image_urls,
           jpr.rectification_remark,
           jpr.rectification_time,
           jpgi.items_name
      from
           jczz_task_place_record  jpr
            LEFT JOIN jczz_patrol_group_item jpgi on jpr.item_id= jpgi.id
             where task_place_self_check_id = #{id}
        </select>
        select jpr.id,
        jpr.item_id,
        jpr.task_place_self_check_id,
        jpr.state,
        jpr.remark,
        jpr.image_urls,
        jpr.create_user,
        jpr.create_time,
        jpr.is_deleted,
        jpr.rectification_image_urls,
        jpr.rectification_remark,
        jpr.rectification_time,
        jpgi.items_name
        from jczz_task_place_record jpr
        LEFT JOIN jczz_patrol_group_item jpgi on jpr.item_id = jpgi.id
        where task_place_self_check_id = #{id}
        <if test="type == 1">
            and jpr.type = 1
        </if>
        <if test="type == 2">
            and jpr.type = 3
        </if>
    </select>
    <sql id="selectTaskPlaceSelfCheck">
       select
@@ -270,24 +285,7 @@
    <select id="selectTaskPlaceSelfCheckById" parameterType="long" resultMap="TaskPlaceSelfCheckDTOResult">
        SELECT
        jtpr.id,
        jtpr.task_id,
        jtpr.task_name,
        jtpr.place_name,
        jtpr.remark,
        jtpr.update_time,
        jtpr.create_time,
        jtpr.house_code,
        jtpr.rectification_end_time,
        jtpr.rectification_complete_time,
        jtpr.rectification_flag,
        jtpr.police_station,
        jtpr.rectification_notice_img_url,
        jtpr.signature_path,
        jtpr.create_user,
        jtpr.image_urls,
        jtpr.STATUS,
        jtpr.delete_flag,
        jtpr.*,
        jp.id jpid,
        jp.place_name,
        jp.location,
@@ -489,8 +487,41 @@
        SELECT count(1)
        FROM jczz_task_place_self_check jtpsc
                 LEFT JOIN jczz_place jp ON jp.house_code = jtpsc.house_code
                 LEFT JOIN jczz_grid jg on jg.grid_code=jp.grid_code
        WHERE jp.jw_grid_code IN
              (SELECT jpag.jw_grid_code FROM jczz_police_affairs_grid jpag WHERE jpag.police_user_id like concat('%',${userId},'%') )
              (SELECT jpag.jw_grid_code FROM jczz_police_affairs_grid jpag WHERE jpag.police_user_id like concat('%',#{userId},'%') )
          AND jtpsc.`status` = 1
          AND jtpsc.`type` = #{type}
          AND jg.community_code=#{neiCode}
    </select>
    <select id="getDetailByTaskId" resultType="org.springblade.modules.task.entity.TaskPlaceSelfCheckEntity">
            SELECT
                jtpsc.*,
                jp.id jpid,
                jp.place_name,
                jp.location,
                jg.grid_name,
                jp.principal,
                jp.principal_phone,
                br.town_name,
                br.village_name,
                bu.`name`,
                jpe.legal_tel,
                jpe.legal_person,
                jt.remark reasonFailure,
                jda.address_name
            FROM
                    jczz_task_place_self_check jtpsc
                    LEFT JOIN jczz_task jt on jt.id = jtpsc.task_id
                    LEFT JOIN jczz_place jp ON jtpsc.house_code = jp.house_code
                    LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
                    LEFT JOIN blade_region br ON br.`code` = jg.community_code
                    LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
                    LEFT JOIN blade_user bu ON bu.id = jtpsc.create_user
                    LEFT JOIN jczz_doorplate_address jda on jda.address_code=jtpsc.house_code
            WHERE jtpsc.task_id = #{taskId}
    </select>
</mapper>