| | |
| | | }) |
| | | @ApiOperation(value = "加载树列表", notes = "传入code") |
| | | public R selectAttAdBaseTree(String parentCode, @ApiIgnore @RequestParam Map<String, Object> obj) { |
| | | String code = obj.get("code").toString(); |
| | | if (code.substring(0,4).indexOf("00") > -1) { |
| | | obj.put("code",code.substring(0,2)); |
| | | } else if (code.substring(0,6).indexOf("00") > -1) { |
| | | obj.put("code",code.substring(0,4)); |
| | | } |
| | | // String code = obj.get("code").toString(); |
| | | // if (code.substring(0,4).indexOf("00") > -1) { |
| | | // obj.put("code",code.substring(0,2)); |
| | | // } else if (code.substring(0,6).indexOf("00") > -1) { |
| | | // obj.put("code",code.substring(0,4)); |
| | | // } |
| | | // 查询并返回 |
| | | return R.data(attAdBaseService.selectAttAdBaseTree(parentCode, obj)); |
| | | } |
| | |
| | | ( 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" a2 on (region."p_ad_code" = a2."ad_code") |
| | | left join sjzt_md."att_ad_base" a3 on (a2."p_ad_code" = a3."ad_code") |
| | | left join sjzt_md."att_ad_base" a4 on (a3."p_ad_code" = a4."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(concat('%', #{param2.code}),'%') |
| | | and concat(region."ad_code",a2."ad_code",a3."ad_code",a4."ad_code") like concat(concat('%', #{param2.code}),'%') |
| | | </if> |
| | | <if test="param2.name!=null and param2.name!=''"> |
| | | and region."ad_name" like concat(concat('%', #{param2.name}),'%') |
| | |
| | | <if test="param2.level!=null and param2.level!=''"> |
| | | and region."ad_grad" < #{param2.level} |
| | | </if> |
| | | and region."ad_grad" != 4 |
| | | <if test="param2.isTowns==null or param2.isTowns==''"> |
| | | and region."ad_grad" != 4 |
| | | </if> |
| | | </where> |
| | | ORDER BY region."order_id" |
| | | </select> |