| | |
| | | jda.region_code, |
| | | jg.community_code neiCode, |
| | | jc.street_code streetCode, |
| | | bu.name realName, |
| | | bu.phone, |
| | | bu.real_name realName, |
| | | ifnull(bu.phone,jtbre.check_telephone) as phone, |
| | | jt.id, |
| | | jt.NAME, |
| | | jt.type, |
| | |
| | | FROM |
| | | jczz_task jt |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jt.house_code |
| | | LEFT JOIN jczz_place jp ON locate(jt.house_code,jp.house_code)>0 and jp.is_deleted = 0 |
| | | LEFT JOIN blade_user bu on bu.id = jt.create_user and bu.is_deleted = 0 |
| | | LEFT JOIN jczz_place jp ON jt.house_code = jp.house_code and jp.is_deleted = 0 |
| | | LEFT JOIN jczz_grid_range jgr on jgr.house_code= jt.house_code |
| | | LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_community jc on jc.`code`= jg.community_code and jc.is_deleted = 0 |
| | | LEFT JOIN jczz_task_bail_reporting_event jtbre on jtbre.task_id = jt.id and jtbre.is_deleted = 0 |
| | | LEFT JOIN blade_user bu on bu.id = jtbre.check_user_id and bu.is_deleted = 0 |
| | | <where> |
| | | <if test="task.userId != null and task.userId != ''"> |
| | | AND jt.house_code IN ( |
| | |
| | | <if test="task.reportType != null and task.reportType != 2 "> |
| | | and jt.report_type = #{task.reportType} |
| | | </if> |
| | | |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="task.roleName != null and task.roleName != ''"> |
| | | <if test="task.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jg.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jg.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="task.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> |
| | | and jt.is_deleted = 0 |
| | | and jt.house_code is not null |
| | | order by jt.create_time desc |