mybatis 的参数是map 时。In语句的接收问题

Controller层

    @RequiresPermissions("platform:district:view")
    @GetMapping()
    public String district(ModelMap mmap) {
        //获取配置文件中的省市区配置
        String areaInfo = iSysConfigService.selectConfigByKey("areaInfo");
        //查询省市区表
        String[] split = areaInfo.split("-");
        Map<String,Object> map=new HashMap<String, Object>();
        map.put("provinceId",split[0]);
        map.put("cityId",split[1]);
        map.put("areaId",split[2]);
        String districts = iDistrictsService.findDistricts(map);
        mmap.put("district",districts);
        return prefix + "/district";
    }

dao层

/**
 * 查询省市区
 * @param map
 * @return
 */
public  String findDistricts(Map<String,Object> map);


//service层
@Override
public String findDistricts(Map<String, Object> map) {
       String districts = districtsMapper.findDistricts(map);
       return districts;
}

//dao层
public  String findDistricts(Map<String,Object> map);

mapper层

    <!--查询省市区-->
    <select id="findDistricts" resultType="java.lang.String" parameterType="map">
      SELECT GROUP_CONCAT(`name`) AS aaa FROM sys_districts WHERE id IN
      (#{provinceId},#{cityId},#{areaId})
    </select>

版权声明:本文为zhengTornado原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。