zhongrj
2024-04-28 ebd41b7b2e44dc8b96f177d7bf88d2f5f997b75c
src/main/java/org/springblade/modules/task/mapper/TaskPlaceSelfCheckMapper.xml
@@ -80,6 +80,7 @@
            <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>
@@ -224,25 +225,24 @@
    <select id="selectPatrolRecordList" parameterType="Long"
            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}
          and jpr.type = '1'
    </select>
    <sql id="selectTaskPlaceSelfCheck">
       select
@@ -489,8 +489,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>