Commit 3c794f59 authored by luben's avatar luben

fix

parent 275c76a0
Pipeline #142811 passed with stages
in 3 minutes and 43 seconds
......@@ -712,19 +712,25 @@ public class RegionController extends BaseController {
@RequestParam(value = "pageSize", required = false) Integer pageSize,
@RequestParam(value = "name", required = false) String name
){
List<String> wgCodeLikes = new ArrayList<>();
if(!StringUtils.isBlank(wgCode)){
wgCodeLikes = Arrays.asList(wgCode.split(","));
}
List<GridRegion> gridRegionList = gridRegionMapper.getThirdRegion(wgType,wgCodeLikes,name);
return AjaxResult.success(gridRegionList);
}
@RequestMapping(value = "/getOneOrTwoRegion",method = RequestMethod.GET)
@ResponseBody
public AjaxResult getOneOrTwoRegion(@RequestParam(value = "level", required = false) String level,
@RequestParam(value = "pageNum", required = false) Integer pageNum,
@RequestParam(value = "pageSize", required = false) Integer pageSize
){
GridRegionExample example = new GridRegionExample();
GridRegionExample.Criteria criteria = example.createCriteria();
criteria.andIsValidEqualTo("1");
criteria.andLevelEqualTo("3");
if(wgType!=null && !StringUtils.isBlank(wgType)){
criteria.andWgTypeEqualTo(wgType);
}
if(wgCode!=null && !StringUtils.isBlank(wgCode)){
criteria.andWgCodeLike(wgCode).andWgCodeNotEqualTo(wgCode);
}
if(name!=null && !StringUtils.isBlank(name)){
criteria.andWgNameLike(name);
}
criteria.andLevelEqualTo(level);
List<GridRegion> gridRegionList = gridRegionMapper.selectByExample(example);
return AjaxResult.success(gridRegionList);
......
......@@ -45,4 +45,6 @@ public interface GridRegionMapper {
List<GridRegion> getByParams(GridRegionSearchParam param);
Integer countByParams(GridRegionSearchParam param);
List<GridRegion> getThirdRegion(@Param("wgType")String wgType,@Param("wgCodeLikes")List<String> wgCodeLikes,@Param("name")String name);
}
\ No newline at end of file
......@@ -612,4 +612,28 @@
and level = #{level}
</if>
</select>
<select id="getThirdRegion" resultType="com.ruoyi.system.domain.grid.GridRegion">
select
<include refid="Base_Column_List" />
from grid_region where is_valid = '1'
<if test="wgCodeLikes != null and wgCodeLikes.size() > 0">
and (
<foreach collection="wgCodeLikes" item="wgCode" open="(" close=")" separator="or">
wg_code like CONCAT(#{wgCode}, '%')
</foreach>
)
and (
<foreach collection="wgCodeLikes" item="wgCode" open="(" close=")" separator="and">
wg_code != #{wgCode}
</foreach>
)
</if>
<if test="wgType != null and wgType != ''">
and wg_type = #{wgType}
</if>
<if test="name != null and name != ''">
and wg_name = #{name}
</if>
and level = 3
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment