Mybatis查询之list作为参数查询
来源:互联网 发布:怎么做淘宝客服 编辑:程序博客网 时间:2024/05/17 03:50
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作为参数查询
- Ibtis和Mybatis多参数查询之list集合查询
- mybatis中传入一个List或Map集合作为查询条件的参数
- Mybatis中通过HaseMap封装参数作为查询条件
- mybatis查询嵌套之参数传递
- mybatis 查询参数为list、数组、map的情况
- 在mybatis查询时使用map以及list参数
- 数组作为SQL查询参数
- 数组作为查询的参数
- mybatis list<map>作为参数 foreach循环
- Mybatis list做条件查询
- Mybatis--查询collection--List<String>
- mybatis学习之查询结果返回List以及Map
- Mybatis多参数查询映射
- Mybatis查询 注意 传入参数
- mybatis之高级查询
- mybatis之关联查询
- mybatis之片段查询
- extjs创建弹窗输入框
- 漏洞修复之 bash漏洞远程命令执行
- Android开发优化之对界面UI的优化
- 如何在网页中嵌入自己想要的字体
- 一个C++字符串替换和截取的实例
- Mybatis查询之list作为参数查询
- Description Resource Path Location Type Java compiler level does not match the version of(图解)
- c++中string 的replace用法
- 移码的再总结
- 对Rxjava的理解以及结合Retrofit使用(一)
- Sublime Text无法使用Emmet插件(附带手动安装)
- Centos下Valgrind使用与安装
- qduoj 韬韬说做出这个泥萌就AK辣
- 分布式系统中生成全局唯一ID方案