概述
dao:
Float findTotMaterial(Map<String,Object> map);
service:
//查询出list昨晚参数
List<String> youndIdLists = youComInfoMapper.findCycCount2(
producecode, farmIdList, dayAge);
Map<String, Object> paramMap2 = new HashMap<String, Object>();
paramMap2.put("list1", youndIdLists);
Float totMaterial = youComInfoMapper.findTotMaterial(paramMap2);
映射xm代码:
<select id="findTotMaterial" resultType="java.lang.Float" parameterType="java.util.Map">
select round(s.totalMaterialNum*1000/(s.youngCount -s.deathCount),2) totMaterial from
(select COALESCE(sum(ins.fMatNum),0) totalMaterialNum,
COALESCE(sum(ys.iCount+ys.iGivCount),0)youngCount,
COALESCE(sum(ins.iDeaCount),0)deathCount
from inspection ins
left JOIN young ys on ins.iYoungId=ys.ID
where ys.ID in
<foreach collection="list1" index="index" item="youngId" open="(" separator="," close=")">
#{youngId}
</foreach>
)s
</select>
最后
以上就是笑点低斑马为你收集整理的Mybatis查询之list作为参数查询的全部内容,希望文章能够帮你解决Mybatis查询之list作为参数查询所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复