<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.springblade.modules.task.mapper.TaskPlaceRectificationMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="taskPlaceRectificationResultMap"
|
type="org.springblade.modules.task.entity.TaskPlaceRectificationEntity">
|
</resultMap>
|
|
|
<select id="selectTaskPlaceRectificationPage" resultMap="taskPlaceRectificationResultMap">
|
select * from jczz_task_place_rectification where is_deleted = 0
|
</select>
|
|
<resultMap type="org.springblade.modules.task.vo.TaskPlaceRectificationVO"
|
id="TaskPlaceRectificationDTOResult">
|
<result property="id" column="id"/>
|
<result property="placeCheckId" column="place_check_id"/>
|
<result property="taskId" column="task_id"/>
|
<result property="status" column="status"/>
|
<result property="taskName" column="task_name"/>
|
<result property="placeName" column="place_name"/>
|
<result property="remark" column="remark"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="createTime" column="create_time"/>
|
<result property="houseCode" column="house_code"/>
|
<result property="rectificationNoticeFlag" column="rectification_notice_flag"/>
|
<result property="rectificationEndTime" column="rectification_end_time"/>
|
<result property="rectificationCompleteTime" column="rectification_complete_time"/>
|
<result property="rectificationFlag" column="rectification_flag"/>
|
<result property="punishFlag" column="punish_flag"/>
|
<result property="policeStation" column="police_station"/>
|
<result property="rectificationNoticeImgUrl" column="rectification_notice_img_url"/>
|
<result property="signaturePath" column="signature_path"/>
|
<result property="createUser" column="create_user"/>
|
<result property="imageUrls" column="image_urls"/>
|
|
<collection property="placePoiLabelVOList" column="jpid" javaType="java.util.List"
|
select="selectPlacePoiLabelList"
|
ofType="org.springblade.modules.place.vo.PlacePoiLabelVO"
|
autoMapping="true">
|
</collection>
|
|
<collection property="patrolRecordVOList" column="place_check_id" select="selectPatrolRecordList"
|
javaType="java.util.List" ofType="org.springblade.modules.patrol.vo.PatrolRecordVO"
|
autoMapping="true">
|
</collection>
|
|
|
</resultMap>
|
|
<select id="selectPlacePoiLabelList" parameterType="Long"
|
resultType="org.springblade.modules.place.vo.PlacePoiLabelVO">
|
SELECT
|
jppl.id,
|
jppl.place_id,
|
jppl.poi_code,
|
jppl.type,
|
jppl.color,
|
jppl.remark,
|
jc.category_name labelName
|
FROM
|
jczz_place_poi_label jppl
|
LEFT JOIN jczz_category jc ON jppl.poi_code = jc.category_no
|
WHERE
|
jppl.type = '3'
|
and place_id = #{jpid}
|
</select>
|
|
|
<select id="selectPatrolRecordList" parameterType="Long"
|
resultType="org.springblade.modules.patrol.vo.PatrolRecordVO">
|
select
|
jpr.id,
|
jpr.item_id,
|
jpr.place_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_patrol_record jpr
|
LEFT JOIN jczz_patrol_group_item jpgi on jpr.item_id= jpgi.id
|
where place_check_id = #{id}
|
</select>
|
|
<sql id="selectTaskPlaceRectification">
|
select
|
id,
|
place_check_id,
|
task_id,
|
status,
|
task_name,
|
place_name,
|
remark,
|
update_time,
|
create_time,
|
house_code,
|
rectification_notice_flag,
|
rectification_end_time,
|
rectification_complete_time,
|
rectification_flag,
|
punish_flag,
|
police_station,
|
rectification_notice_img_url,
|
signature_path,
|
create_user,
|
image_urls
|
from
|
jczz_task_place_rectification
|
</sql>
|
|
<select id="selectTaskPlaceRectificationById" parameterType="long" resultMap="TaskPlaceRectificationDTOResult">
|
SELECT
|
jtpr.id,
|
jtpr.place_check_id,
|
jtpr.task_id,
|
jtpr.STATUS,
|
jtpr.task_name,
|
jtpr.remark,
|
jtpr.update_time,
|
jtpr.create_time,
|
jtpr.house_code,
|
jtpr.rectification_notice_flag,
|
jtpr.rectification_end_time,
|
jtpr.rectification_complete_time,
|
jtpr.rectification_flag,
|
jtpr.punish_flag,
|
jtpr.police_station,
|
jtpr.rectification_notice_img_url,
|
jtpr.signature_path,
|
jtpr.create_user,
|
jtpr.image_urls,
|
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_rectification jtpr
|
LEFT JOIN jczz_task jt on jt.id = jtpr.task_id
|
LEFT JOIN jczz_place jp ON jtpr.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 = jtpr.create_user
|
LEFT JOIN jczz_doorplate_address jda on jda.address_code=jtpr.house_code
|
WHERE jtpr.task_id = #{taskId}
|
</select>
|
|
<select id="selectTaskPlaceRectificationList"
|
parameterType="org.springblade.modules.task.vo.TaskPlaceRectificationVO"
|
resultMap="TaskPlaceRectificationDTOResult">
|
SELECT
|
jtpr.id,
|
jtpr.place_check_id,
|
jtpr.task_id,
|
jtpr.STATUS,
|
jtpr.task_name,
|
jtpr.remark,
|
jtpr.update_time,
|
jtpr.create_time,
|
jtpr.house_code,
|
jtpr.rectification_notice_flag,
|
jtpr.rectification_end_time,
|
jtpr.rectification_complete_time,
|
jtpr.rectification_flag,
|
jtpr.punish_flag,
|
jtpr.police_station,
|
jtpr.rectification_notice_img_url,
|
jtpr.signature_path,
|
jtpr.create_user,
|
jtpr.image_urls,
|
jpag.pcs_name deptName,
|
jp.id jpid,
|
jp.place_name,
|
jp.location,
|
jg.grid_name,
|
jp.principal,
|
jp.principal_phone,
|
jp.nine_type,
|
br.town_name streetName,
|
br.village_name communityName,
|
bu.`name`,
|
jpe.legal_tel,
|
jpe.legal_person,
|
jp.location as address_name
|
FROM
|
jczz_task_place_rectification jtpr
|
LEFT JOIN jczz_place jp ON jtpr.house_code = jp.house_code and jp.is_deleted = 0
|
LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code and jg.is_deleted = 0
|
LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id and jpe.is_deleted = 0
|
LEFT JOIN blade_user bu ON bu.id = jtpr.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
|
LEFT JOIN blade_region br ON br.`code` = jpag.community_code
|
<where>
|
<if test="taskPalce.id != null ">and jtpr.id = #{taskPalce.id}</if>
|
<if test="taskPalce.placeCheckId != null ">and jtpr.place_check_id = #{taskPalce.placeCheckId}</if>
|
<if test="taskPalce.taskId != null ">and jtpr.task_id = #{taskPalce.taskId}</if>
|
<if test="taskPalce.status != null and taskPalce.status != 2 ">and jtpr.status = #{taskPalce.status}</if>
|
|
<if test="taskPalce.status != null and taskPalce.status == 2 ">and jtpr.status in (2,3)</if>
|
|
<if test="taskPalce.taskName != null and taskPalce.taskName != ''">and jtpr.task_name =
|
#{taskPalce.taskName}
|
</if>
|
|
<if test="taskPalce.startTime!=null and taskPalce.startTime!=''">
|
and jtpr.create_time>=#{taskPalce.startTime}
|
</if>
|
<if test="taskPalce.endTime!=null and taskPalce.endTime!=''">
|
and jtpr.create_time<=#{taskPalce.endTime}
|
</if>
|
|
<if test="taskPalce.streetName!=null and taskPalce.streetName!=''">
|
and br.town_name like concat('%',#{taskPalce.streetName},'%')
|
</if>
|
|
<if test="taskPalce.communityName!=null and taskPalce.communityName!=''">
|
and br.village_name like concat('%',#{taskPalce.communityName},'%')
|
</if>
|
|
<if test="taskPalce.placeName!=null and taskPalce.placeName!=''">
|
and jp.place_name like concat('%',#{taskPalce.placeName},'%')
|
</if>
|
|
<if test="taskPalce.addressName!=null and taskPalce.addressName!=''">
|
and jp.location like concat('%',#{taskPalce.addressName},'%')
|
</if>
|
|
<if test="taskPalce.deptName!=null and taskPalce.deptName!=''">
|
and jpag.pcs_name like concat('%',#{taskPalce.deptName},'%')
|
</if>
|
|
<if test="nineTypeList!=null and nineTypeList.size()>0">
|
and jp.nine_type in
|
<foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType">
|
#{nineType}
|
</foreach>
|
</if>
|
|
<if test="taskPalce.punishFlag!=null">
|
and jp.punish_flag = #{taskPalce.punishFlag}
|
</if>
|
|
<if test="taskPalce.remark != null and taskPalce.remark != ''">and jtpr.remark = #{taskPalce.remark}</if>
|
<if test="taskPalce.updateTime != null ">and jtpr.update_time = #{taskPalce.updateTime}</if>
|
<if test="taskPalce.createTime != null ">and jtpr.create_time = #{taskPalce.createTime}</if>
|
<if test="taskPalce.houseCode != null and taskPalce.houseCode != ''">and jtpr.house_code =
|
#{taskPalce.houseCode}
|
</if>
|
<if test="taskPalce.rectificationNoticeFlag != null ">and jtpr.rectification_notice_flag =
|
#{taskPalce.rectificationNoticeFlag}
|
</if>
|
<if test="taskPalce.rectificationEndTime != null ">and jtpr.rectification_end_time =
|
#{taskPalce.rectificationEndTime}
|
</if>
|
<if test="taskPalce.rectificationCompleteTime != null ">and jtpr.rectification_complete_time =
|
#{taskPalce.rectificationCompleteTime}
|
</if>
|
<if test="taskPalce.rectificationFlag != null ">and jtpr.rectification_flag =
|
#{taskPalce.rectificationFlag}
|
</if>
|
<if test="taskPalce.punishFlag != null ">and jtpr.punish_flag = #{taskPalce.punishFlag}</if>
|
<if test="taskPalce.policeStation != null and taskPalce.policeStation != ''">and jtpr.police_station =
|
#{taskPalce.policeStation}
|
</if>
|
<if test="taskPalce.rectificationNoticeImgUrl != null and taskPalce.rectificationNoticeImgUrl != ''">and
|
jtpr.rectification_notice_img_url = #{taskPalce.rectificationNoticeImgUrl}
|
</if>
|
<if test="taskPalce.signaturePath != null and taskPalce.signaturePath != ''">and jtpr.signature_path =
|
#{taskPalce.signaturePath}
|
</if>
|
<if test="taskPalce.createUser != null ">and jtpr.create_user = #{taskPalce.createUser}</if>
|
<if test="taskPalce.imageUrls != null and taskPalce.imageUrls != ''">and jtpr.image_urls =
|
#{taskPalce.imageUrls}
|
</if>
|
<if test="isAdministrator==2">
|
<choose>
|
<when test="taskPalce.roleName != null and taskPalce.roleName != ''">
|
<if test="taskPalce.roleName=='wgy'">
|
<choose>
|
<when test="gridCodeList !=null and gridCodeList.size()>0">
|
and jp.grid_code in
|
<foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
</when>
|
<otherwise>
|
and jp.grid_code in ('')
|
</otherwise>
|
</choose>
|
</if>
|
<if test="taskPalce.roleName=='mj'">
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and jpag.community_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")"
|
separator=",">
|
#{code}
|
</foreach>
|
</when>
|
<otherwise>
|
and jpag.community_code in ('')
|
</otherwise>
|
</choose>
|
</if>
|
</when>
|
<otherwise>
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and
|
(
|
jg.grid_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
or
|
jpag.community_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
)
|
</when>
|
<otherwise>
|
and
|
(
|
jg.grid_code in ('') or jpag.community_code in ('')
|
)
|
</otherwise>
|
</choose>
|
</otherwise>
|
</choose>
|
</if>
|
</where>
|
order by jtpr.create_time desc
|
</select>
|
|
|
<select id="getNineTypeStatistics1" resultType="list">
|
SELECT
|
bd.dict_key,
|
bd.dict_value,
|
(
|
SELECT
|
count( 1 )
|
FROM
|
jczz_place jp
|
LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
|
<where>
|
<if test="isAdministrator==2">
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and jg.grid_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
</when>
|
</choose>
|
</if>
|
and jp.nine_type = bd.dict_key
|
</where>
|
) number
|
FROM
|
blade_dict_biz bd
|
WHERE
|
bd.`code` = 'nineType'
|
AND bd.is_sealed = 0
|
AND bd.dict_key > 0
|
|
|
</select>
|
<select id="getNineTypeStatistics" resultType="java.util.Map">
|
|
SELECT
|
bd.dict_key,
|
bd.dict_value,
|
(
|
SELECT
|
count(jpr.id)
|
FROM
|
jczz_patrol_record jpr
|
LEFT JOIN jczz_place_check jpc ON jpr.place_check_id = jpc.id
|
LEFT JOIN jczz_place jp ON jpc.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
|
<where>
|
<if test="isAdministrator==2">
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and jg.grid_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
</when>
|
</choose>
|
</if>
|
and jpr.state = '0'
|
and jp.nine_type = bd.dict_key
|
and br.town_code =#{code}
|
<if test="taskPlaceRectification.startTime!=null and taskPlaceRectification.startTime!=''">
|
and jpc.create_time>=#{taskPlaceRectification.startTime}
|
</if>
|
<if test="taskPlaceRectification.endTime!=null and taskPlaceRectification.endTime!=''">
|
and jpc.create_time<=#{taskPlaceRectification.endTime}
|
</if>
|
</where>
|
) number
|
FROM
|
blade_dict_biz bd
|
WHERE
|
bd.code = 'nineType'
|
AND bd.is_sealed = 0
|
AND bd.dict_key > 0
|
order by bd.sort asc
|
|
</select>
|
|
<resultMap type="org.springblade.modules.task.excel.TaskPlaceRectificationExcel"
|
id="TaskPlaceRectificationExcelResult">
|
<result property="placeName" column="place_name"/>
|
<result property="createTime" column="create_time"/>
|
<result property="rectificationNoticeFlag" column="rectification_notice_flag"/>
|
<result property="rectificationEndTime" column="rectification_end_time"/>
|
<result property="rectificationFlag" column="rectification_flag"/>
|
|
<collection property="patrolRecordVOList" column="place_check_id" select="selectPatrolRecordList"
|
javaType="java.util.List" ofType="org.springblade.modules.patrol.vo.PatrolRecordVO"
|
autoMapping="true">
|
</collection>
|
</resultMap>
|
|
<select id="export"
|
resultMap="TaskPlaceRectificationExcelResult">
|
SELECT
|
jtpr.id,
|
jtpr.place_check_id,
|
jtpr.task_id,
|
jtpr.STATUS,
|
jtpr.task_name,
|
jtpr.remark,
|
jtpr.update_time,
|
jtpr.create_time,
|
jtpr.house_code,
|
jtpr.rectification_notice_flag,
|
jtpr.rectification_end_time,
|
jtpr.rectification_complete_time,
|
jtpr.rectification_flag,
|
jtpr.punish_flag,
|
jtpr.police_station,
|
jtpr.rectification_notice_img_url,
|
jtpr.signature_path,
|
jtpr.create_user,
|
jtpr.image_urls,
|
jpag.pcs_name deptName,
|
jp.id jpid,
|
jp.place_name,
|
jp.location,
|
jg.grid_name,
|
jp.principal,
|
jp.principal_phone,
|
jp.nine_type,
|
br.town_name streetName,
|
br.village_name communityName,
|
bu.`name`,
|
jpe.legal_tel,
|
jpe.legal_person,
|
jp.location as address_name
|
FROM
|
jczz_task_place_rectification jtpr
|
LEFT JOIN jczz_place jp ON jtpr.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 = jtpr.create_user
|
LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code
|
<where>
|
<if test="taskPalce.id != null ">and jtpr.id = #{taskPalce.id}</if>
|
<if test="taskPalce.placeCheckId != null ">and jtpr.place_check_id = #{taskPalce.placeCheckId}</if>
|
<if test="taskPalce.taskId != null ">and jtpr.task_id = #{taskPalce.taskId}</if>
|
<if test="taskPalce.status != null ">and jtpr.status = #{taskPalce.status}</if>
|
<if test="taskPalce.taskName != null and taskPalce.taskName != ''">and jtpr.task_name =
|
#{taskPalce.taskName}
|
</if>
|
|
<if test="taskPalce.startTime!=null and taskPalce.startTime!=''">
|
and jtpr.create_time>=#{taskPalce.startTime}
|
</if>
|
<if test="taskPalce.endTime!=null and taskPalce.endTime!=''">
|
and jtpr.create_time<=#{taskPalce.endTime}
|
</if>
|
|
<if test="taskPalce.placeName!=null and taskPalce.placeName!=''">
|
and jp.place_name like concat('%',#{taskPalce.placeName},'%')
|
</if>
|
|
<if test="taskPalce.addressName!=null and taskPalce.addressName!=''">
|
and jp.location like concat('%',#{taskPalce.addressName},'%')
|
</if>
|
|
<if test="taskPalce.deptName!=null and taskPalce.deptName!=''">
|
and jpag.pcs_name like concat('%',#{taskPalce.deptName},'%')
|
</if>
|
|
<if test="nineTypeList!=null and nineTypeList.size()>0">
|
and jp.nine_type in
|
<foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType">
|
#{nineType}
|
</foreach>
|
</if>
|
|
<if test="taskPalce.punishFlag!=null">
|
and jp.punish_flag = #{taskPalce.punishFlag}
|
</if>
|
|
<if test="taskPalce.remark != null and taskPalce.remark != ''">and jtpr.remark = #{taskPalce.remark}</if>
|
<if test="taskPalce.updateTime != null ">and jtpr.update_time = #{taskPalce.updateTime}</if>
|
<if test="taskPalce.createTime != null ">and jtpr.create_time = #{taskPalce.createTime}</if>
|
<if test="taskPalce.houseCode != null and taskPalce.houseCode != ''">and jtpr.house_code =
|
#{taskPalce.houseCode}
|
</if>
|
<if test="taskPalce.rectificationNoticeFlag != null ">and jtpr.rectification_notice_flag =
|
#{taskPalce.rectificationNoticeFlag}
|
</if>
|
<if test="taskPalce.rectificationEndTime != null ">and jtpr.rectification_end_time =
|
#{taskPalce.rectificationEndTime}
|
</if>
|
<if test="taskPalce.rectificationCompleteTime != null ">and jtpr.rectification_complete_time =
|
#{taskPalce.rectificationCompleteTime}
|
</if>
|
<if test="taskPalce.rectificationFlag != null ">and jtpr.rectification_flag =
|
#{taskPalce.rectificationFlag}
|
</if>
|
<if test="taskPalce.punishFlag != null ">and jtpr.punish_flag = #{taskPalce.punishFlag}</if>
|
<if test="taskPalce.policeStation != null and taskPalce.policeStation != ''">and jtpr.police_station =
|
#{taskPalce.policeStation}
|
</if>
|
<if test="taskPalce.rectificationNoticeImgUrl != null and taskPalce.rectificationNoticeImgUrl != ''">and
|
jtpr.rectification_notice_img_url = #{taskPalce.rectificationNoticeImgUrl}
|
</if>
|
<if test="taskPalce.signaturePath != null and taskPalce.signaturePath != ''">and jtpr.signature_path =
|
#{taskPalce.signaturePath}
|
</if>
|
<if test="taskPalce.createUser != null ">and jtpr.create_user = #{taskPalce.createUser}</if>
|
<if test="taskPalce.imageUrls != null and taskPalce.imageUrls != ''">and jtpr.image_urls =
|
#{taskPalce.imageUrls}
|
</if>
|
<if test="isAdministrator==2">
|
<choose>
|
<when test="taskPalce.roleName != null and taskPalce.roleName != ''">
|
<if test="taskPalce.roleName=='wgy'">
|
<choose>
|
<when test="gridCodeList !=null and gridCodeList.size()>0">
|
and jp.grid_code in
|
<foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
</when>
|
<otherwise>
|
and jp.grid_code in ('')
|
</otherwise>
|
</choose>
|
</if>
|
<if test="taskPalce.roleName=='mj'">
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and jpag.community_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")"
|
separator=",">
|
#{code}
|
</foreach>
|
</when>
|
<otherwise>
|
and jpag.community_code in ('')
|
</otherwise>
|
</choose>
|
</if>
|
</when>
|
<otherwise>
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and
|
(
|
jg.grid_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
or
|
jpag.community_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
)
|
</when>
|
<otherwise>
|
and
|
(
|
jg.grid_code in ('') or jpag.community_code in ('')
|
)
|
</otherwise>
|
</choose>
|
</otherwise>
|
</choose>
|
</if>
|
</where>
|
order by jtpr.create_time desc
|
</select>
|
|
<select id="getCount" resultType="java.lang.Integer">
|
|
SELECT count(1)
|
FROM
|
jczz_task_place_rectification jtpr
|
LEFT JOIN jczz_place jp ON jtpr.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 = jtpr.create_user
|
LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code
|
<where>
|
<if test="taskPalce.communityCode != null ">and jg.community_code = #{taskPalce.communityCode}</if>
|
<if test="taskPalce.status != null ">and jtpr.status = #{taskPalce.status}</if>
|
<if test="isAdministrator==2">
|
<choose>
|
<when test="taskPalce.roleName != null and taskPalce.roleName != ''">
|
<if test="taskPalce.roleName=='wgy'">
|
<choose>
|
<when test="gridCodeList !=null and gridCodeList.size()>0">
|
and jp.grid_code in
|
<foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
</when>
|
<otherwise>
|
and jp.grid_code in ('')
|
</otherwise>
|
</choose>
|
</if>
|
<if test="taskPalce.roleName=='mj'">
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and br.village_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")"
|
separator=",">
|
#{code}
|
</foreach>
|
</when>
|
<otherwise>
|
and br.village_code in ('')
|
</otherwise>
|
</choose>
|
</if>
|
</when>
|
<otherwise>
|
<choose>
|
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
|
and
|
(
|
jg.grid_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
or
|
jpag.community_code in
|
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
|
#{code}
|
</foreach>
|
)
|
</when>
|
<otherwise>
|
and
|
(
|
jg.grid_code in ('') or jpag.community_code in ('')
|
)
|
</otherwise>
|
</choose>
|
</otherwise>
|
</choose>
|
</if>
|
</where>
|
</select>
|
|
|
</mapper>
|