BdglFoodMealMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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.BdglFoodMealMapper">
  6. <resultMap type="BdglFoodMeal" id="BdglFoodMealResult">
  7. <result property="id" column="id" />
  8. <result property="stapleFood" column="staple_food" />
  9. <result property="menu" column="menu" />
  10. <result property="type1" column="type1" />
  11. <result property="jiucanCount" column="jiucan_count" />
  12. <result property="lianduiCount" column="liandui_count" />
  13. <result property="wailaiCount" column="wailai_count" />
  14. <result property="mianfen" column="mianfen" />
  15. <result property="dami" column="dami" />
  16. <result property="rolei" column="rolei" />
  17. <result property="yulei" column="yulei" />
  18. <result property="youlei" column="youlei" />
  19. <result property="huangdo" column="huangdo" />
  20. <result property="suchai" column="suchai" />
  21. <result property="shuiguo" column="shuiguo" />
  22. <result property="tang" column="tang" />
  23. <result property="ranliao" column="ranliao" />
  24. <result property="tiaoliao" column="tiaoliao" />
  25. <result property="foodId" column="food_id" />
  26. </resultMap>
  27. <sql id="selectBdglFoodMealVo">
  28. select id, staple_food, menu, type1, jiucan_count, liandui_count, wailai_count, mianfen, dami, rolei, yulei, youlei, huangdo, suchai, shuiguo, tang, ranliao, tiaoliao, food_id from bdgl_food_meal
  29. </sql>
  30. <select id="selectBdglFoodMealList" parameterType="BdglFoodMeal" resultMap="BdglFoodMealResult">
  31. <include refid="selectBdglFoodMealVo"/>
  32. <where>
  33. <if test="stapleFood != null and stapleFood != ''"> and staple_food = #{stapleFood}</if>
  34. <if test="menu != null and menu != ''"> and menu = #{menu}</if>
  35. <if test="type1 != null and type1 != ''"> and type1 = #{type1}</if>
  36. <if test="jiucanCount != null "> and jiucan_count = #{jiucanCount}</if>
  37. <if test="lianduiCount != null "> and liandui_count = #{lianduiCount}</if>
  38. <if test="wailaiCount != null "> and wailai_count = #{wailaiCount}</if>
  39. <if test="mianfen != null "> and mianfen = #{mianfen}</if>
  40. <if test="dami != null "> and dami = #{dami}</if>
  41. <if test="rolei != null "> and rolei = #{rolei}</if>
  42. <if test="yulei != null "> and yulei = #{yulei}</if>
  43. <if test="youlei != null "> and youlei = #{youlei}</if>
  44. <if test="huangdo != null "> and huangdo = #{huangdo}</if>
  45. <if test="suchai != null "> and suchai = #{suchai}</if>
  46. <if test="shuiguo != null "> and shuiguo = #{shuiguo}</if>
  47. <if test="tang != null "> and tang = #{tang}</if>
  48. <if test="ranliao != null "> and ranliao = #{ranliao}</if>
  49. <if test="tiaoliao != null "> and tiaoliao = #{tiaoliao}</if>
  50. <if test="foodId != null "> and food_id = #{foodId}</if>
  51. </where>
  52. </select>
  53. <select id="selectBdglFoodMealById" parameterType="Integer" resultMap="BdglFoodMealResult">
  54. <include refid="selectBdglFoodMealVo"/>
  55. where id = #{id}
  56. </select>
  57. <insert id="insertBdglFoodMeal" parameterType="BdglFoodMeal" useGeneratedKeys="true" keyProperty="id">
  58. insert into bdgl_food_meal
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="stapleFood != null">staple_food,</if>
  61. <if test="menu != null">menu,</if>
  62. <if test="type1 != null">type1,</if>
  63. <if test="jiucanCount != null">jiucan_count,</if>
  64. <if test="lianduiCount != null">liandui_count,</if>
  65. <if test="wailaiCount != null">wailai_count,</if>
  66. <if test="mianfen != null">mianfen,</if>
  67. <if test="dami != null">dami,</if>
  68. <if test="rolei != null">rolei,</if>
  69. <if test="yulei != null">yulei,</if>
  70. <if test="youlei != null">youlei,</if>
  71. <if test="huangdo != null">huangdo,</if>
  72. <if test="suchai != null">suchai,</if>
  73. <if test="shuiguo != null">shuiguo,</if>
  74. <if test="tang != null">tang,</if>
  75. <if test="ranliao != null">ranliao,</if>
  76. <if test="tiaoliao != null">tiaoliao,</if>
  77. <if test="foodId != null">food_id,</if>
  78. </trim>
  79. <trim prefix="values (" suffix=")" suffixOverrides=",">
  80. <if test="stapleFood != null">#{stapleFood},</if>
  81. <if test="menu != null">#{menu},</if>
  82. <if test="type1 != null">#{type1},</if>
  83. <if test="jiucanCount != null">#{jiucanCount},</if>
  84. <if test="lianduiCount != null">#{lianduiCount},</if>
  85. <if test="wailaiCount != null">#{wailaiCount},</if>
  86. <if test="mianfen != null">#{mianfen},</if>
  87. <if test="dami != null">#{dami},</if>
  88. <if test="rolei != null">#{rolei},</if>
  89. <if test="yulei != null">#{yulei},</if>
  90. <if test="youlei != null">#{youlei},</if>
  91. <if test="huangdo != null">#{huangdo},</if>
  92. <if test="suchai != null">#{suchai},</if>
  93. <if test="shuiguo != null">#{shuiguo},</if>
  94. <if test="tang != null">#{tang},</if>
  95. <if test="ranliao != null">#{ranliao},</if>
  96. <if test="tiaoliao != null">#{tiaoliao},</if>
  97. <if test="foodId != null">#{foodId},</if>
  98. </trim>
  99. </insert>
  100. <update id="updateBdglFoodMeal" parameterType="BdglFoodMeal">
  101. update bdgl_food_meal
  102. <trim prefix="SET" suffixOverrides=",">
  103. <if test="stapleFood != null">staple_food = #{stapleFood},</if>
  104. <if test="menu != null">menu = #{menu},</if>
  105. <if test="type1 != null">type1 = #{type1},</if>
  106. <if test="jiucanCount != null">jiucan_count = #{jiucanCount},</if>
  107. <if test="lianduiCount != null">liandui_count = #{lianduiCount},</if>
  108. <if test="wailaiCount != null">wailai_count = #{wailaiCount},</if>
  109. <if test="mianfen != null">mianfen = #{mianfen},</if>
  110. <if test="dami != null">dami = #{dami},</if>
  111. <if test="rolei != null">rolei = #{rolei},</if>
  112. <if test="yulei != null">yulei = #{yulei},</if>
  113. <if test="youlei != null">youlei = #{youlei},</if>
  114. <if test="huangdo != null">huangdo = #{huangdo},</if>
  115. <if test="suchai != null">suchai = #{suchai},</if>
  116. <if test="shuiguo != null">shuiguo = #{shuiguo},</if>
  117. <if test="tang != null">tang = #{tang},</if>
  118. <if test="ranliao != null">ranliao = #{ranliao},</if>
  119. <if test="tiaoliao != null">tiaoliao = #{tiaoliao},</if>
  120. <if test="foodId != null">food_id = #{foodId},</if>
  121. </trim>
  122. where id = #{id}
  123. </update>
  124. <delete id="deleteBdglFoodMealById" parameterType="Integer">
  125. delete from bdgl_food_meal where id = #{id}
  126. </delete>
  127. <delete id="deleteBdglFoodMealByIds" parameterType="String">
  128. delete from bdgl_food_meal where id in
  129. <foreach item="id" collection="array" open="(" separator="," close=")">
  130. #{id}
  131. </foreach>
  132. </delete>
  133. </mapper>