BdglCookbookRegistrationMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.grassrootsregistration.mapper.BdglCookbookRegistrationMapper">
  6. <resultMap type="BdglCookbookRegistration" id="BdglCookbookRegistrationResult">
  7. <result property="id" column="id" />
  8. <result property="cookbookId" column="cookbook_id" />
  9. <result property="typelist" column="typelist" />
  10. <result property="timelist" column="timelist" />
  11. <result property="weeklist" column="weeklist" />
  12. <result property="cookcategoryIds" column="cookcategory_ids" />
  13. <result property="peopleIds" column="people_ids" />
  14. <result property="createtime" column="createtime" />
  15. <result property="updatetime" column="updatetime" />
  16. <result property="cookcategoryNames" column="cookcategory_names" />
  17. <result property="peopleNames" column="people_names" />
  18. </resultMap>
  19. <sql id="selectBdglCookbookRegistrationVo">
  20. select id, cookbook_id, typelist, timelist, weeklist, cookcategory_ids, people_ids, createtime, updatetime, cookcategory_names, people_names from bdgl_cookbook_registration
  21. </sql>
  22. <select id="selectBdglCookbookRegistrationList" parameterType="BdglCookbookRegistration" resultMap="BdglCookbookRegistrationResult">
  23. <include refid="selectBdglCookbookRegistrationVo"/>
  24. <where>
  25. <if test="cookbookId != null "> and cookbook_id = #{cookbookId}</if>
  26. <if test="typelist != null and typelist != ''"> and typelist = #{typelist}</if>
  27. <if test="timelist != null and timelist != ''"> and timelist = #{timelist}</if>
  28. <if test="weeklist != null and weeklist != ''"> and weeklist = #{weeklist}</if>
  29. <if test="cookcategoryIds != null and cookcategoryIds != ''"> and cookcategory_ids = #{cookcategoryIds}</if>
  30. <if test="peopleIds != null and peopleIds != ''"> and people_ids = #{peopleIds}</if>
  31. <if test="createtime != null and createtime != ''"> and createtime = #{createtime}</if>
  32. <if test="updatetime != null and updatetime != ''"> and updatetime = #{updatetime}</if>
  33. <if test="cookcategoryNames != null and cookcategoryNames != ''"> and cookcategory_names = #{cookcategoryNames}</if>
  34. <if test="peopleNames != null and peopleNames != ''"> and people_names = #{peopleNames}</if>
  35. </where>
  36. </select>
  37. <select id="selectBdglCookbookRegistrationById" parameterType="Integer" resultMap="BdglCookbookRegistrationResult">
  38. <include refid="selectBdglCookbookRegistrationVo"/>
  39. where id = #{id}
  40. </select>
  41. <insert id="insertBdglCookbookRegistration" parameterType="BdglCookbookRegistration" useGeneratedKeys="true" keyProperty="id">
  42. insert into bdgl_cookbook_registration
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="cookbookId != null">cookbook_id,</if>
  45. <if test="typelist != null and typelist != ''">typelist,</if>
  46. <if test="timelist != null and timelist != ''">timelist,</if>
  47. <if test="weeklist != null">weeklist,</if>
  48. <if test="cookcategoryIds != null">cookcategory_ids,</if>
  49. <if test="peopleIds != null">people_ids,</if>
  50. <if test="createtime != null">createtime,</if>
  51. <if test="updatetime != null">updatetime,</if>
  52. <if test="cookcategoryNames != null">cookcategory_names,</if>
  53. <if test="peopleNames != null">people_names,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="cookbookId != null">#{cookbookId},</if>
  57. <if test="typelist != null and typelist != ''">#{typelist},</if>
  58. <if test="timelist != null and timelist != ''">#{timelist},</if>
  59. <if test="weeklist != null">#{weeklist},</if>
  60. <if test="cookcategoryIds != null">#{cookcategoryIds},</if>
  61. <if test="peopleIds != null">#{peopleIds},</if>
  62. <if test="createtime != null">#{createtime},</if>
  63. <if test="updatetime != null">#{updatetime},</if>
  64. <if test="cookcategoryNames != null">#{cookcategoryNames},</if>
  65. <if test="peopleNames != null">#{peopleNames},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateBdglCookbookRegistration" parameterType="BdglCookbookRegistration">
  69. update bdgl_cookbook_registration
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="cookbookId != null">cookbook_id = #{cookbookId},</if>
  72. <if test="typelist != null and typelist != ''">typelist = #{typelist},</if>
  73. <if test="timelist != null and timelist != ''">timelist = #{timelist},</if>
  74. <if test="weeklist != null">weeklist = #{weeklist},</if>
  75. <if test="cookcategoryIds != null">cookcategory_ids = #{cookcategoryIds},</if>
  76. <if test="peopleIds != null">people_ids = #{peopleIds},</if>
  77. <if test="createtime != null">createtime = #{createtime},</if>
  78. <if test="updatetime != null">updatetime = #{updatetime},</if>
  79. <if test="cookcategoryNames != null">cookcategory_names = #{cookcategoryNames},</if>
  80. <if test="peopleNames != null">people_names = #{peopleNames},</if>
  81. </trim>
  82. where id = #{id}
  83. </update>
  84. <delete id="deleteBdglCookbookRegistrationById" parameterType="Integer">
  85. delete from bdgl_cookbook_registration where id = #{id}
  86. </delete>
  87. <delete id="deleteBdglCookbookRegistrationByIds" parameterType="String">
  88. delete from bdgl_cookbook_registration where id in
  89. <foreach item="id" collection="array" open="(" separator="," close=")">
  90. #{id}
  91. </foreach>
  92. </delete>
  93. </mapper>