我是靠谱客的博主 笑点低斑马,这篇文章主要介绍Mybatis查询之list作为参数查询,现在分享给大家,希望可以做个参考。

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作为参数查询内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(133)

评论列表共有 0 条评论

立即
投稿
返回
顶部