| | |
| | | ctr."intention_customer_flag" as intentionCustomerFlag, |
| | | ctr."is_deleted" as isDeleted, |
| | | ctc.waterCode, |
| | | arb."name" as waterName, |
| | | aab."ad_name" as areaName, |
| | | ctc.userName |
| | | cas."tag_title" as tagTitle, |
| | | ctc.userName, |
| | | arb."name" as waterName, |
| | | arb."res_reg_code" resRegCode, |
| | | arb."eng_scal" engScal, |
| | | arb."res_type" resType, |
| | | arb."rv_name" rvName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | if(ifnull(cas."tag_title",0)>'0',if(instr(cas."tag_title",'未发现险情')>0,1,if(instr(cas."tag_title",'发现险情')>0,2,0)),0) isDange, |
| | | if(ifnull(cas."tag_title",0)>'0',if(instr(cas."tag_title",'是否巡查责任人-未识别')>0,0,if(instr(cas."tag_title",'不是巡查责任人')>0,1,if(instr(cas."tag_title",'是巡查责任人')>0,2,0))),0) isMan, |
| | | if(ifnull(cas."tag_title",0)>'0',if(instr(cas."tag_title",'是否巡查-未识别')>0,0,if(instr(cas."tag_title",'未巡查')>0,1,if(instr(cas."tag_title",'已巡查')>0,2,0))),0) isPatrol, |
| | | if(ifnull(cas."tag_title",0)>'0',if(instr(cas."tag_title",'是否超汛限-未识别')>0,0,if(instr(cas."tag_title",'未超汛限')>0,1,if(instr(cas."tag_title",'超汛限')>0,2,0))),0) isOver |
| | | from "SJZT_ODS"."call_task_result" ctr |
| | | left join |
| | | ( |
| | |
| | | on ctr."task_id" = ctc."task_id" and ctr."callee_number" = ctc."callee_number" |
| | | left join "SJZT_MD"."att_res_base" arb on ctc.waterCode = arb."code" |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') |
| | | left join |
| | | ( |
| | | SELECT ctra."call_id", replace(WM_CONCAT(ctag."tag_title"),',', ',') as "tag_title" from "SJZT_ODS"."call_tag" ctag |
| | | left join "SJZT_ODS"."call_task_result_attribute" ctra on ctag."id" = ctra."attribute_value" |
| | | GROUP BY ctra."call_id" |
| | | ) cas |
| | | on cas."call_id" = ctr."call_id" |
| | | where 1=1 |
| | | <if test="callTaskResult.taskId!=null and callTaskResult.taskId!=''"> |
| | | and ctr."task_id" = #{callTaskResult.taskId} |
| | | </if> |
| | | <if test="list != null and list.size()>0"> |
| | | and aab."ad_code" in |
| | | <foreach collection="list" item="adCode" separator ="," open="(" close=")"> |
| | | #{adCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="callTaskResult.waterName!=null and callTaskResult.waterName!=''"> |
| | | and ctc."call_task_callee_content" like concat('%',#{callTaskResult.waterName},'%') |
| | | and arb."name" like concat('%',#{callTaskResult.waterName},'%') |
| | | </if> |
| | | <if test="callTaskResult.userName!=null and callTaskResult.userName!=''"> |
| | | and ctc."call_task_callee_content" like concat('%',#{callTaskResult.userName},'%') |
| | | and ctc.userName like concat('%',#{callTaskResult.userName},'%') |
| | | </if> |
| | | <if test="callTaskResult.startTime!=null and callTaskResult.startTime!=''"> |
| | | and date_format(ctr."gmt_create",'%Y-%m-%d') >= #{callTaskResult.startTime} |
| | |
| | | |
| | | <!--通过行政区编号获取水库名称--> |
| | | <select id="getWaterNameByAreaCode" resultType="java.lang.String"> |
| | | select "name" from SJZT_MD."att_res_base" where concat("ad_guid",'000000') = #{areaCode} |
| | | select "name" from SJZT_MD."att_res_base" where concat("ad_guid",'000000') = #{adCode} |
| | | </select> |
| | | |
| | | <!--查询所有下级区域--> |
| | | <select id="getAllChildrenAreaByAreaCode" resultType="java.lang.String"> |
| | | select "ad_code" from SJZT_MD."att_ad_base" |
| | | start with "ad_code" = #{areaCode} |
| | | CONNECT BY PRIOR "ad_code" = "p_ad_code" |
| | | </select> |
| | | </mapper> |