Mybatis
tyroscz
coding 改变世界
展开
-
MyBatis-Plus sum函数求和
mybatis plus sum函数QueryWrapper<CmsVideo> ew = new QueryWrapper<>();ew.eq("user_id", userId );ew.select("IFNULL(sum(give_num),0) AS giveNum");Map<String, Object> map = cmsVideoService.getMap(ew);System.out.println(map);打印 map结果{giv原创 2020-08-17 11:17:21 · 11095 阅读 · 0 评论 -
MyBatis 传多个参数查询(四种解决方案)
Mybatis传多个参数(三种解决方案)1.参数出现的顺序 方式传参List<CmsImg> selectCmsImgListT1(String modelType, Long modelId);<select id="selectCmsImgListT1" resultMap="BaseResultMap">SELECT * FROM cms_img WHERE model_type=#{arg0} AND model_id=#{arg1} AND del_flag='0原创 2020-08-18 16:25:12 · 2119 阅读 · 0 评论