| | |
| | | aab."ad_name" as adName, |
| | | trmp1."user_unit" areaUnitName,trmp1."user_name" areaUsername,trmp1."user_phone" areaPhone,trmp1."position" |
| | | areaPosition,trmp1."guid" areaUserGuid, |
| | | |
| | | trmp2."user_unit" customsUnitName,trmp2."user_name" customsUsername,trmp2."user_phone" |
| | | customsPhone,trmp2."position" customsPosition,trmp2."guid" customsUserGuid, |
| | | |
| | | trmp3."user_unit" manageUnitUnitName,trmp3."user_name" manageUnitUsername,trmp3."user_phone" |
| | | manageUnitPhone,trmp3."position" manageUnitPosition,trmp3."guid" manageUnitUserGuid, |
| | | |
| | | trmp4."user_unit" technologyUnitName,trmp4."user_name" technologyUsername,trmp4."user_phone" |
| | | technologyPhone,trmp4."position" technologyPosition,trmp4."guid" technologyUserGuid, |
| | | |
| | | trmp5."user_unit" patrolUnitName,trmp5."user_name" patrolUsername,trmp5."user_phone" |
| | | patrolPhone,trmp5."position" patrolPosition,trmp5."guid" patrolUserGuid |
| | | from SJZT_MD."att_res_base" arb |
| | |
| | | and (aab."ad_code" = #{params.adCode} or aa."ad_code" = #{params.adCode} or ab."ad_code" = #{params.adCode} |
| | | or ac."ad_code" = #{params.adCode}) |
| | | </if> |
| | | |
| | | <if test="params.userName !=null and params.userName != ''"> |
| | | AND CONCAT(trmp1."user_name",trmp2."user_name",trmp3."user_name",trmp4."user_name",trmp5."user_name") LIKE CONCAT('%',#{params.userName},'%') |
| | | </if> |
| | | <if test="params.userPhone != null and params.userPhone !=''"> |
| | | AND CONCAT(trmp1."user_phone",trmp2."user_phone",trmp3."user_phone",trmp4."user_phone",trmp5."user_phone") LIKE CONCAT('%',#{params.userPhone},'%') |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <!--查询各类型责任人--> |
| | |
| | | <if test="attResBase.label ==null or attResBase.label == ''"> |
| | | "label" = '', |
| | | </if> |
| | | "height_base_std_tp" = #{attResBase.heightBaseStdTp}, |
| | | "is_gate" = #{attResBase.isGate}, |
| | | "update_time" = #{attResBase.updateTime} |
| | | WHERE "guid" = #{attResBase.guid} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateRsvr"> |
| | | UPDATE SJZT_ODS."yg_rsvr_b" SET |
| | | "tb_height_base_std_tp" = #{attResBase.tbHeightBaseStdTp} |
| | | WHERE "guid" = #{attResBase.guid} |
| | | </update> |
| | | |
| | |
| | | |
| | | </update> |
| | | |
| | | |
| | | <!--根据水库名称、所在区域查询改水库的数量--> |
| | | <select id="getWaterCountByResNameAndCountyName" resultType="java.lang.Integer"> |
| | | SELECT count(1) |
| | |
| | | aab."p_ad_name" = #{cityName} |
| | | and aab."ad_name" = #{countyName} |
| | | </select> |
| | | <select id="getAttResBaseUserExcel" resultType="cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel"> |
| | | select |
| | | arb."guid", arb."name", arb."res_loc" as place, arb."res_reg_code" as resRegCode, arb."eng_scal" as engScal, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,4) as townName, |
| | | aab."ad_name" as adName, |
| | | trmp1."user_unit" areaUnitName,trmp1."user_name" areaUsername,trmp1."user_phone" areaPhone,trmp1."position" |
| | | areaPosition,trmp1."guid" areaUserGuid, |
| | | |
| | | trmp2."user_unit" customsUnitName,trmp2."user_name" customsUsername,trmp2."user_phone" |
| | | customsPhone,trmp2."position" customsPosition,trmp2."guid" customsUserGuid, |
| | | |
| | | trmp3."user_unit" manageUnitUnitName,trmp3."user_name" manageUnitUsername,trmp3."user_phone" |
| | | manageUnitPhone,trmp3."position" manageUnitPosition,trmp3."guid" manageUnitUserGuid, |
| | | |
| | | trmp4."user_unit" technologyUnitName,trmp4."user_name" technologyUsername,trmp4."user_phone" |
| | | technologyPhone,trmp4."position" technologyPosition,trmp4."guid" technologyUserGuid, |
| | | |
| | | trmp5."user_unit" patrolUnitName,trmp5."user_name" patrolUsername,trmp5."user_phone" |
| | | patrolPhone,trmp5."position" patrolPosition,trmp5."guid" patrolUserGuid |
| | | from SJZT_MD."att_res_base" arb |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = arb."interior_ad_guid" |
| | | left join "SJZT_MD"."att_ad_base" aa on aab."p_ad_code" = aa."ad_code" |
| | | left join "SJZT_MD"."att_ad_base" ab on aa."p_ad_code" = ab."ad_code" |
| | | left join "SJZT_MD"."att_ad_base" ac on ab."p_ad_code" = ac."ad_code" |
| | | left join ( |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") |
| | | "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=1 GROUP BY "res_guid" |
| | | ) trmp1 on arb."guid" = trmp1."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") |
| | | "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=2 GROUP BY "res_guid" |
| | | ) trmp2 on arb."guid" = trmp2."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") |
| | | "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=3 GROUP BY "res_guid" |
| | | ) trmp3 on arb."guid" = trmp3."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") |
| | | "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=4 GROUP BY "res_guid" |
| | | ) trmp4 on arb."guid" = trmp4."res_guid" |
| | | |
| | | left join ( |
| | | select "res_guid",WM_Concat("guid") "guid",WM_Concat("user_unit") "user_unit",WM_Concat("user_name") |
| | | "user_name",WM_Concat("user_phone") "user_phone",WM_Concat("position") "position" |
| | | from "SJZT_MD"."att_res_manage_person" where "type"=5 GROUP BY "res_guid" |
| | | ) trmp5 on arb."guid" = trmp5."res_guid" |
| | | where 1=1 |
| | | <if test="params.name !=null and params.name !=''"> |
| | | AND arb."name" LIKE CONCAT('%',#{params.name},'%') |
| | | </if> |
| | | <if test="params.resRegCode !=null and params.resRegCode !=''"> |
| | | AND arb."res_reg_code" LIKE CONCAT('%',#{params.resRegCode},'%') |
| | | </if> |
| | | <if test="params.engScal !=null and params.engScal !=''"> |
| | | AND arb."eng_scal" LIKE CONCAT('%',#{params.engScal},'%') |
| | | </if> |
| | | <if test="params.isWorkable==1"> |
| | | AND ( |
| | | ( |
| | | (arb."eng_scal" = '大(1)型' or arb."eng_scal" = '大(2)型' or arb."eng_scal" = '中型') |
| | | and |
| | | trmp1."user_unit" is not null and trmp2."user_unit" is not null and trmp3."user_unit" is not null |
| | | ) |
| | | or |
| | | ( |
| | | (arb."eng_scal" = '小(1)型' or arb."eng_scal" = '小(2)型') |
| | | and |
| | | trmp1."user_unit" is not null and trmp2."user_unit" is not null and trmp3."user_unit" is not null and |
| | | trmp4."user_unit" is not null and trmp5."user_unit" is not null |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="params.isWorkable==2"> |
| | | AND ( |
| | | (arb."eng_scal" = '大(1)型' or arb."eng_scal" = '大(2)型' or arb."eng_scal" = '中型') |
| | | and |
| | | (trmp1."user_unit" is null or trmp2."user_unit" is null or trmp3."user_unit" is null) |
| | | or |
| | | ( |
| | | (arb."eng_scal" = '小(1)型' or arb."eng_scal" = '小(2)型') |
| | | and |
| | | (trmp1."user_unit" is null or trmp2."user_unit" is null or trmp3."user_unit" is null or trmp4."user_unit" is |
| | | null or trmp5."user_unit" is null) |
| | | ) |
| | | ) |
| | | </if> |
| | | |
| | | <if test="params.adCode != null and params.adCode != '' "> |
| | | and (aab."ad_code" = #{params.adCode} or aa."ad_code" = #{params.adCode} or ab."ad_code" = #{params.adCode} |
| | | or ac."ad_code" = #{params.adCode}) |
| | | </if> |
| | | |
| | | <if test="params.userName !=null and params.userName != ''"> |
| | | AND CONCAT(trmp1."user_name",trmp2."user_name",trmp3."user_name",trmp4."user_name",trmp5."user_name") LIKE CONCAT('%',#{params.userName},'%') |
| | | </if> |
| | | <if test="params.userPhone != null and params.userPhone !=''"> |
| | | AND CONCAT(trmp1."user_phone",trmp2."user_phone",trmp3."user_phone",trmp4."user_phone",trmp5."user_phone") LIKE CONCAT('%',#{params.userPhone},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |