mybatisplus @Select传参列表
直接看示例:
列表处理:
dictids = dictids + "'" +defineInfo.getDictionaryId() + "',"; }
处理结果示例:
'80500460','15874218','75106467','13010881','74244402','40883530','26553563','34135343','28425507','54467705','27436447','77228748','1731054','41308488','81248106',
切除最后的逗号:
String ids = DictIds.substring(0, DictIds.length() - 1);
MAP示例
public interface DictionaryInfoMapper extends BaseMapper<DictionaryInfo> {
//使用列表传参,需要转换处理
@Select(value = "select id,key as value,value as name from xxxx_xxxx_info where dictionary_id IN (${DictIds})")
List<xxx> listDictfidlesByDictId(@Param("DictIds") String DictIds);
}