KwsMenuMappingDao.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.system.dao.KwsMenuMappingDao">
  4. <insert id="saveBatch">
  5. insert into kws_menu_mapping (
  6. id,
  7. menu_id,
  8. mapping_id,
  9. create_by,
  10. create_time,
  11. update_by,
  12. update_time,
  13. del_flag,
  14. status,
  15. remark
  16. ) values
  17. <foreach collection="list" item="item" separator=",">
  18. (
  19. #{item.id},
  20. #{item.menuId},
  21. #{item.mappingId},
  22. #{item.createBy},
  23. #{item.createTime},
  24. #{item.updateBy},
  25. #{item.updateTime},
  26. #{item.delFlag},
  27. #{item.status},
  28. #{item.remark}
  29. )
  30. </foreach>
  31. </insert>
  32. <update id="updateById">
  33. update kws_menu_mapping
  34. set menu_id = #{menuId},
  35. mapping_id = #{mappingId},
  36. create_by = #{createBy},
  37. create_time = #{createTime},
  38. update_by = #{updateBy},
  39. update_time = #{updateTime},
  40. del_flag = #{delFlag},
  41. status = #{status},
  42. remark = #{remark}
  43. where id = #{id}
  44. </update>
  45. <select id="selectByMenuId" resultType="com.sckw.system.model.KwsMenuMapping">
  46. select a.* from kws_menu_mapping a where a.menu_id = #{id} and a.del_flag = 0
  47. </select>
  48. <select id="selectByMenuIds" resultType="com.sckw.system.model.KwsMenuMapping">
  49. select a.* from kws_menu_mapping a where a.menu_id in
  50. <foreach collection="idList" item="item" open="(" close=")" separator=",">
  51. #{item}
  52. </foreach>
  53. and a.del_flag = 0
  54. </select>
  55. </mapper>