| | |
| | | }) |
| | | @ApiOperation(value = "加载树列表", notes = "传入code") |
| | | public R<List<AttAdBaseVO>> select(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)); |
| | | }else if (code.substring(0,8).indexOf("00") > -1){ |
| | | obj.put("code",code.substring(0,8)); |
| | | } |
| | | // 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)); |
| | | // }else if (code.substring(0,8).indexOf("00") > -1){ |
| | | // obj.put("code",code.substring(0,8)); |
| | | // } |
| | | List<AttAdBaseVO> list = attAdBaseService.lazyTree(parentCode, obj); |
| | | return R.data(listNodeLazyVO(list)); |
| | | } |
| | |
| | | ( 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},'%') |