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作为参数查询内容请搜索靠谱客的其他文章。
发表评论 取消回复