ibatis :启动报错:element type "foreach" must be declared怎么解决呢? 5
启动报错:elementtype"foreach"mustbedeclared怎么解决呢?代码如下:业务层List<String>allCodeList={'123','...
启动报错:element type "foreach" must be declared怎么解决呢?代码如下:
业务层
List<String> allCodeList = {'123','456','789'};
dao层
public List<area> getAreaCode(List<String> allCodeList);
mybatis mapper.xml里配置查询语句
<select id="getAreaCode" resultMap="BaseMap">
select ta.areacode from table_a ta
where exists (slelect tb.proId from table_b where ta.areacode = tb.areacode)
and exists (select 1 from dual where ta.areacode in
<foreach collection="list" item="allCodeList" index="index" open="(" separator="," close=")">
#{allCodeList}
</foreach>
)
</select>
启动报错:element type "foreach" must be declared怎么解决呢? 展开
业务层
List<String> allCodeList = {'123','456','789'};
dao层
public List<area> getAreaCode(List<String> allCodeList);
mybatis mapper.xml里配置查询语句
<select id="getAreaCode" resultMap="BaseMap">
select ta.areacode from table_a ta
where exists (slelect tb.proId from table_b where ta.areacode = tb.areacode)
and exists (select 1 from dual where ta.areacode in
<foreach collection="list" item="allCodeList" index="index" open="(" separator="," close=")">
#{allCodeList}
</foreach>
)
</select>
启动报错:element type "foreach" must be declared怎么解决呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询