发布网友 发布时间:2022-05-02 20:42
共2个回答
懂视网 时间:2022-05-03 01:03
= #{userId} AND eventType IN <foreach collection="eventTypeList" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> AND createTime >= #{beginTime} AND createTime <= #{endTime} ORDER BY createTime </select>
<select id="findActivityInfoListByCategoryId" resultMap="BaseResultMap" > SELECT a.* FROM t_activity_info a WHERE a.categoryId in <foreach collection="list" item="categoryId" open="(" close=")" separator=","> #{categoryId} </foreach> and a.isDelete = 0 and a.`endTime` > now() <if test="organizationId != null and organizationId != 3"> AND a.organizationId = #{organizationId,jdbcType=INTEGER} </if> ORDER BY a.createTime DESC </select>
<select id="selectOneByRewardType" resultMap="BaseResultMap"> select w.* from t_lucky_winning w inner join t_lucky_activity a on w.luckyId = a.luckyId and a.activityId = #{activityId,jdbcType=INTEGER} inner join t_lucky_reward r on w.rewardId = r.id where r.rewardId in( <foreach collection="rewardIds" item="rewardId" separator=","> #{rewardId,jdbcType=INTEGER} </foreach>) order by w.luckytime desc limit 1 </select>
性能优化之mybatis实现接口的批量查询,减少数据库的查询消耗
标签:sel mybatis 接口 tty upd activity create find status
热心网友 时间:2022-05-02 22:11
批量查询不一定只能用mybatis的,还有很多其他软件也可以实现!