BdglFoodShoppingMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.BdglFoodShoppingMapper">
  6. <resultMap type="BdglFoodShopping" id="BdglFoodShoppingResult">
  7. <result property="id" column="id" />
  8. <result property="peopleId" column="people_id" />
  9. <result property="zName" column="z_name" />
  10. <result property="zWeight" column="z_weight" />
  11. <result property="zMoney" column="z_money" />
  12. <result property="total" column="total" />
  13. <result property="foodId" column="food_id" />
  14. <result property="fName" column="f_name" />
  15. <result property="fWeight" column="f_weight" />
  16. <result property="fMoney" column="f_money" />
  17. <result property="qName" column="q_name" />
  18. <result property="qWeight" column="q_weight" />
  19. <result property="qMoney" column="q_money" />
  20. <result property="createtime" column="createtime" />
  21. <result property="updatetime" column="updatetime" />
  22. <result property="peoplename" column="peoplename" />
  23. </resultMap>
  24. <sql id="selectBdglFoodShoppingVo">
  25. select id, people_id, z_name, z_weight, z_money, total, food_id, f_name, f_weight, f_money, q_name, q_weight, q_money, createtime, updatetime,peoplename from bdgl_food_shopping
  26. </sql>
  27. <select id="selectBdglFoodShoppingList" parameterType="BdglFoodShopping" resultMap="BdglFoodShoppingResult">
  28. <include refid="selectBdglFoodShoppingVo"/>
  29. <where>
  30. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  31. <if test="zName != null and zName != ''"> and z_name like concat('%', #{zName}, '%')</if>
  32. <if test="zWeight != null "> and z_weight = #{zWeight}</if>
  33. <if test="zMoney != null "> and z_money = #{zMoney}</if>
  34. <if test="total != null "> and total = #{total}</if>
  35. <if test="foodId != null "> and food_id = #{foodId}</if>
  36. <if test="fName != null and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
  37. <if test="fWeight != null "> and f_weight = #{fWeight}</if>
  38. <if test="fMoney != null "> and f_money = #{fMoney}</if>
  39. <if test="qName != null and qName != ''"> and q_name like concat('%', #{qName}, '%')</if>
  40. <if test="qWeight != null "> and q_weight = #{qWeight}</if>
  41. <if test="qMoney != null "> and q_money = #{qMoney}</if>
  42. <if test="createtime != null "> and createtime = #{createtime}</if>
  43. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  44. <if test="peoplename != null "> and peoplename = #{peoplename}</if>
  45. </where>
  46. </select>
  47. <select id="selectBdglFoodShoppingById" parameterType="Integer" resultMap="BdglFoodShoppingResult">
  48. <include refid="selectBdglFoodShoppingVo"/>
  49. where id = #{id}
  50. </select>
  51. <insert id="insertBdglFoodShopping" parameterType="BdglFoodShopping" useGeneratedKeys="true" keyProperty="id">
  52. insert into bdgl_food_shopping
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="peopleId != null">people_id,</if>
  55. <if test="zName != null">z_name,</if>
  56. <if test="zWeight != null">z_weight,</if>
  57. <if test="zMoney != null">z_money,</if>
  58. <if test="total != null">total,</if>
  59. <if test="foodId != null">food_id,</if>
  60. <if test="fName != null">f_name,</if>
  61. <if test="fWeight != null">f_weight,</if>
  62. <if test="fMoney != null">f_money,</if>
  63. <if test="qName != null">q_name,</if>
  64. <if test="qWeight != null">q_weight,</if>
  65. <if test="qMoney != null">q_money,</if>
  66. <if test="createtime != null">createtime,</if>
  67. <if test="updatetime != null">updatetime,</if>
  68. <if test="peoplename != null">peoplename,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="peopleId != null">#{peopleId},</if>
  72. <if test="zName != null">#{zName},</if>
  73. <if test="zWeight != null">#{zWeight},</if>
  74. <if test="zMoney != null">#{zMoney},</if>
  75. <if test="total != null">#{total},</if>
  76. <if test="foodId != null">#{foodId},</if>
  77. <if test="fName != null">#{fName},</if>
  78. <if test="fWeight != null">#{fWeight},</if>
  79. <if test="fMoney != null">#{fMoney},</if>
  80. <if test="qName != null">#{qName},</if>
  81. <if test="qWeight != null">#{qWeight},</if>
  82. <if test="qMoney != null">#{qMoney},</if>
  83. <if test="createtime != null">#{createtime},</if>
  84. <if test="updatetime != null">#{updatetime},</if>
  85. <if test="peoplename != null">#{peoplename},</if>
  86. </trim>
  87. </insert>
  88. <update id="updateBdglFoodShopping" parameterType="BdglFoodShopping">
  89. update bdgl_food_shopping
  90. <trim prefix="SET" suffixOverrides=",">
  91. <if test="peopleId != null">people_id = #{peopleId},</if>
  92. <if test="zName != null">z_name = #{zName},</if>
  93. <if test="zWeight != null">z_weight = #{zWeight},</if>
  94. <if test="zMoney != null">z_money = #{zMoney},</if>
  95. <if test="total != null">total = #{total},</if>
  96. <if test="foodId != null">food_id = #{foodId},</if>
  97. <if test="fName != null">f_name = #{fName},</if>
  98. <if test="fWeight != null">f_weight = #{fWeight},</if>
  99. <if test="fMoney != null">f_money = #{fMoney},</if>
  100. <if test="qName != null">q_name = #{qName},</if>
  101. <if test="qWeight != null">q_weight = #{qWeight},</if>
  102. <if test="qMoney != null">q_money = #{qMoney},</if>
  103. <if test="createtime != null">createtime = #{createtime},</if>
  104. <if test="updatetime != null">updatetime = #{updatetime},</if>
  105. <if test="peoplename != null">peoplename = #{peoplename},</if>
  106. </trim>
  107. where id = #{id}
  108. </update>
  109. <delete id="deleteBdglFoodShoppingById" parameterType="Integer">
  110. delete from bdgl_food_shopping where id = #{id}
  111. </delete>
  112. <delete id="deleteBdglFoodShoppingByIds" parameterType="String">
  113. delete from bdgl_food_shopping where id in
  114. <foreach item="id" collection="array" open="(" separator="," close=")">
  115. #{id}
  116. </foreach>
  117. </delete>
  118. <delete id="deleteBdglFoodShopping">
  119. delete from bdgl_food_shopping where food_id = #{id}
  120. </delete>
  121. </mapper>