| | |
| | | |
| | | <select id="selectTaskPage" resultMap="taskResultMap"> |
| | | SELECT |
| | | IFNULL(jda.address_name,jp.location)address_name , |
| | | IFNULL( jda.address_name, jp.location ) address_name, |
| | | jt.id, |
| | | jt.name, |
| | | jt.NAME, |
| | | jt.type, |
| | | jt.frequency, |
| | | jt.remark, |
| | |
| | | jt.create_user, |
| | | jt.update_time, |
| | | jt.update_user, |
| | | jt.status, |
| | | jt.STATUS, |
| | | jt.tenant_id, |
| | | jt.create_dept, |
| | | jt.is_deleted, |
| | | jt.house_code, |
| | | jt.report_type |
| | | FROM |
| | | jczz_gridman jgm |
| | | LEFT JOIN jczz_grid jg ON jgm.grid_id = jg.id |
| | | LEFT JOIN jczz_grid_range jgr ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_task jt ON jgr.house_code = jt.house_code |
| | | jczz_task jt |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jt.house_code |
| | | LEFT JOIN jczz_place jp on jp.house_code=jgr.house_code |
| | | LEFT JOIN jczz_place jp ON jp.house_code = jt.house_code |
| | | <where> |
| | | <if test="task.userId != null and task.userId != ''"> |
| | | and jgm.user_id = #{task.userId} |
| | | AND jt.house_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | <if test="task.communityCode != null and task.communityCode != ''"> |
| | | and jg.community_code = #{task.communityCode} |
| | | </if> |
| | | AND jgm.user_id = #{task.userId} ) |
| | | </if> |
| | | <if test="task.communityCode != null and task.communityCode != ''"> |
| | | and jg.community_code = #{task.communityCode} |
| | | </if> |
| | | |
| | | <if test="task.status != null and task.status != null"> |
| | | and jt.status = #{task.status} |
| | | </if> |
| | |
| | | <if test="task.reportType == null"> |
| | | and jt.report_type in (2,3,4,5,6) |
| | | </if> |
| | | and jt.is_deleted = 0 |
| | | order by jt.create_time desc |
| | | </where> |
| | | </select> |