| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="taskResidencePermitApplyResultMap" |
| | | type="org.springblade.modules.task.entity.TaskResidencePermitApplyEntity"> |
| | | type="org.springblade.modules.task.vo.TaskResidencePermitApplyVO"> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectTaskResidencePermitApplyPage" resultMap="taskResidencePermitApplyResultMap"> |
| | | select * from jczz_task_residence_permit_apply |
| | | select |
| | | jtrpa.*, |
| | | br.town_name streetName, |
| | | jg.grid_name, |
| | | jda.aoi_name, |
| | | br.village_name communityName, |
| | | jda.address_name as addressName |
| | | from jczz_task_residence_permit_apply jtrpa |
| | | left join jczz_doorplate_address jda on jda.address_code = jtrpa.house_code |
| | | LEFT JOIN jczz_house jh on jh.house_code=jtrpa.house_code |
| | | left join jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0 |
| | | left join blade_region br on br.code = jg.community_code |
| | | <where> |
| | | and jtrpa.is_deleted = 0 |
| | | <if test="residen.id != null ">and id = #{residen.id}</if> |
| | | <if test="residen.name != null and residen.name != ''">and name = #{residen.name}</if> |
| | | <if test="residen.phone != null and residen.phone != ''">and phone = #{residen.phone}</if> |
| | |
| | | <if test="residen.taskId != null ">and task_id = #{residen.taskId}</if> |
| | | <if test="residen.createTime != null ">and create_time = #{residen.createTime}</if> |
| | | <if test="residen.updateTime != null ">and update_time = #{residen.updateTime}</if> |
| | | <if test="residen.status != null ">and status = #{residen.status}</if> |
| | | <if test="residen.createUser != null ">and create_user = #{residen.createUser}</if> |
| | | <if test="residen.houseRentalId != null ">and house_rental_id = #{residen.houseRentalId}</if> |
| | | <if test="residen.isDeleted != null ">and is_deleted = #{residen.isDeleted}</if> |
| | | <if test="residen.remak != null and residen.remak != ''">and remak = #{residen.remak}</if> |
| | | and is_deleted = 0 |
| | | <if test="residen.gridCode != null and residen.gridCode != ''"> and grid_code = #{residen.gridCode}</if> |
| | | <if test="residen.updateUser != null "> and update_user = #{residen.updateUser}</if> |
| | | <if test="residen.confirmUserId != null "> and confirm_user_id = #{residen.confirmUserId}</if> |
| | | <if test="residen.confirmTime != null "> and confirm_time = #{residen.confirmTime}</if> |
| | | <if test="residen.confirmFlag != null "> and confirm_flag = #{residen.confirmFlag}</if> |
| | | <if test="residen.confirmNotion != null and residen.confirmNotion != ''"> and confirm_notion = #{residen.confirmNotion}</if> |
| | | <if test="residen.jwGridCode != null and residen.jwGridCode != ''"> and jw_grid_code = #{residen.jwGridCode}</if> |
| | | |
| | | <if test="isAdministrator==2"> |
| | | <!-- 网格员及其他 --> |
| | | <if test="vo.roleType ==null"> |
| | | <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 |
| | | jp.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and ( |
| | | jg.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jp.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and jg.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | <if test="vo.confirmUserId != null "> |
| | | or jtrfr.confirm_user_id = #{vo.confirmUserId} |
| | | </if> |
| | | |
| | | </if> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | SELECT count(1) |
| | | FROM jczz_task_residence_permit_apply jtrpa |
| | | WHERE jtrpa.jw_grid_code IN |
| | | (SELECT jpag.jw_grid_code FROM jczz_police_affairs_grid jpag WHERE jpag.police_user_id like concat('%',${userId},'%') ) |
| | | AND jtrpa.`confirm_flag` = 1 |
| | | |
| | | </select> |
| | | |
| | | <resultMap type="org.springblade.modules.task.dto.TaskResidencePermitApplyDTO" |
| | |
| | | <result property="taskId" column="task_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="status" column="status"/> |
| | | <result property="createUser" column="create_user"/> |
| | | <result property="houseRentalId" column="house_rental_id"/> |
| | | <result property="isDeleted" column="is_deleted"/> |
| | | <result property="remak" column="remak"/> |
| | | <result property="gridCode" column="grid_code"/> |
| | | <result property="updateUser" column="update_user"/> |
| | | <result property="confirmUserId" column="confirm_user_id"/> |
| | | <result property="confirmTime" column="confirm_time"/> |
| | | <result property="confirmFlag" column="confirm_flag"/> |
| | | <result property="confirmNotion" column="confirm_notion"/> |
| | | <result property="jwGridCode" column="jw_grid_code"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectTaskResidencePermitApply"> |
| | | select id, |
| | | name, |
| | | phone, |
| | | id_card, |
| | | address, |
| | | house_code, |
| | | task_id, |
| | | create_time, |
| | | update_time, |
| | | status, |
| | | create_user, |
| | | house_rental_id, |
| | | is_deleted, |
| | | remak |
| | | from jczz_task_residence_permit_apply |
| | | select |
| | | id, |
| | | name, |
| | | phone, |
| | | id_card, |
| | | address, |
| | | house_code, |
| | | task_id, |
| | | create_time, |
| | | update_time, |
| | | create_user, |
| | | house_rental_id, |
| | | is_deleted, |
| | | remak, |
| | | grid_code, |
| | | update_user, |
| | | confirm_user_id, |
| | | confirm_time, |
| | | confirm_flag, |
| | | confirm_notion, |
| | | jw_grid_code |
| | | from |
| | | jczz_task_residence_permit_apply |
| | | </sql> |
| | | |
| | | |
| | | |
| | | </mapper> |