| | |
| | | ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM "SJZT_MD"."att_ad_base" WHERE "p_ad_code" = region."ad_code" ) AS "has_children" |
| | | FROM |
| | | "SJZT_MD"."att_ad_base" region |
| | | left join "SJZT_MD"."att_ad_base" b on (region."p_ad_code" = b."ad_code") |
| | | left join "SJZT_MD"."att_ad_base" c on (b."p_ad_code" = c."ad_code") |
| | | left join "SJZT_MD"."att_ad_base" d on (c."p_ad_code" = d."ad_code") |
| | | <where> |
| | | <if test="param1!=null"> |
| | | and region."p_ad_code" = #{param1} |
| | | </if> |
| | | <if test="param2.code!=null and param2.code!=''"> |
| | | and region."ad_code" like concat(#{param2.code},'%') |
| | | and concat(region."ad_code",b."ad_code",c."ad_code",d."ad_code") like concat('%',#{param2.code},'%') |
| | | </if> |
| | | <if test="param2.name!=null and param2.name!=''"> |
| | | and region."ad_name" like concat('%',#{param2.name},'%') |
| | |
| | | ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM YWXT."att_ad_base" WHERE "p_ad_code" = region."ad_code" ) AS "has_children" |
| | | FROM |
| | | YWXT."att_ad_base" region |
| | | left join "YWXT"."att_ad_base" b on (region."p_ad_code" = b."ad_code") |
| | | left join "YWXT"."att_ad_base" c on (b."p_ad_code" = c."ad_code") |
| | | left join "YWXT"."att_ad_base" d on (c."p_ad_code" = d."ad_code") |
| | | <where> |
| | | <if test="param1!=null"> |
| | | and region."p_ad_code" = #{param1} |
| | | </if> |
| | | <if test="param2.code!=null and param2.code!=''"> |
| | | and region."ad_code" like concat(#{param2.code},'%') |
| | | and concat(region."ad_code",b."ad_code",c."ad_code",d."ad_code") like concat('%',#{param2.code},'%') |
| | | </if> |
| | | <if test="param2.name!=null and param2.name!=''"> |
| | | and region."ad_name" like concat('%',#{param2.name},'%') |
| | |
| | | start with "ad_code" = (select "interior_ad_guid" from SJZT_MD."att_res_base" where "guid" = #{res_cd} ) |
| | | CONNECT BY PRIOR "p_ad_code" = "ad_code" |
| | | ) |
| | | and locate(br.role_name,concat('%',#{roleName},'%'))>0 |
| | | and br.role_name in |
| | | <foreach collection="roleName.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and bu.phone is not null and bu.phone!='' |
| | | </select> |
| | | |