MyBatis mapper记录

一万年来谁著史,三千里外欲封侯。这篇文章主要讲述MyBatis mapper记录相关的知识,希望能为你提供帮助。
1、批量删除接口

int deleteUserMenu(Integer menuId, List< Integer> listId);

xml
< delete id="deleteUserMenu"> delete from user_menu where menu_id = #{menuId} and user_id in < foreach collection="listId" item="item" index="index" open="(" separator="," close=")"> #{item} < /foreach> < /delete>

 
2、查询字段集合接口
List< CheckTaskDTO> getTaskList(@Param("listTaskStatus") List< Integer> listTaskStatus, @Param("taskName") String taskName);

xml
< select id="getTaskList" resultType="com.sunwin.robotcloud.db.dto.CheckTaskDTO"> SELECT < include refid="Base_Column_List"/> FROM check_task WHERE < if test="taskName != null and taskName != ‘‘"> task_name like "%"#{taskName}"%" < /if> < if test="listTaskStatus != null and listTaskStatus.size() > 0"> and task_status in < foreach collection="listTaskStatus" item="item" index="index" open="(" separator="," close=")"> #{item} < /foreach> < /if> < /select>

【MyBatis mapper记录】 

    推荐阅读