DailyRecordFoodbasicinfochecksFileDao.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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="cn.ourwill.module.house.dao.daily.DailyRecordFoodbasicinfochecksFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfochecksFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="uuid" property="uuid"/>
  7. <result column="foodbasicinfoId" property="foodbasicinfoId"/>
  8. <result column="checkTime" property="checkTime"/>
  9. <result column="water" property="water"/>
  10. <result column="boldfat" property="boldfat"/>
  11. <result column="glutenWater" property="glutenWater"/>
  12. <result column="checker" property="checker"/>
  13. <result column="cId" property="cId"/>
  14. <result column="uId" property="uId"/>
  15. <result column="cTime" property="cTime"/>
  16. <result column="uTime" property="uTime"/>
  17. <result column="version" property="version"/>
  18. <result column="houseId" property="houseId"/>
  19. <result column="eatScore" property="eatScore"/>
  20. <result column="file_uuid" property="fileUuid"/>
  21. </resultMap>
  22. <sql id="columns">
  23. id ,
  24. uuid ,
  25. foodbasicinfoId ,
  26. checkTime ,
  27. water ,
  28. boldfat ,
  29. glutenWater ,
  30. checker ,
  31. cId ,
  32. uId ,
  33. cTime ,
  34. uTime ,
  35. version ,
  36. houseId ,
  37. eatScore,
  38. file_uuid
  39. </sql>
  40. <sql id="joinCols">
  41. </sql>
  42. <select id="get" resultMap="baseMap">
  43. SELECT
  44. <include refid="columns"/>
  45. FROM daily_record_foodbasicinfochecks_file a
  46. <include refid="joinCols"/>
  47. WHERE a.id = #{id}
  48. </select>
  49. <select id="findList" resultMap="baseMap">
  50. SELECT
  51. <include refid="columns"/>
  52. FROM daily_record_foodbasicinfochecks_file a
  53. <include refid="joinCols"/>
  54. <where>
  55. <if test="id !=null">
  56. and id = #{id}
  57. </if>
  58. <if test="foodbasicinfoId !=null">
  59. and foodbasicinfoId = #{foodbasicinfoId}
  60. </if>
  61. <if test="checkTime !=null">
  62. and checkTime = #{checkTime}
  63. </if>
  64. <if test="searchStartDate !=null">
  65. and STR_TO_DATE(checkTime, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
  66. </if>
  67. <if test="searchEndDate !=null">
  68. and STR_TO_DATE(checkTime, '%Y-%m-%d') &lt;= #{searchEndDate}
  69. </if>
  70. <if test="water !=null">
  71. and water = #{water}
  72. </if>
  73. <if test="boldfat !=null">
  74. and boldfat = #{boldfat}
  75. </if>
  76. <if test="glutenWater !=null">
  77. and glutenWater = #{glutenWater}
  78. </if>
  79. <if test="checker !=null">
  80. and checker = #{checker}
  81. </if>
  82. <if test="cId !=null">
  83. and cId = #{cId}
  84. </if>
  85. <if test="uId !=null">
  86. and uId = #{uId}
  87. </if>
  88. <if test="cTime !=null">
  89. and cTime = #{cTime}
  90. </if>
  91. <if test="uTime !=null">
  92. and uTime = #{uTime}
  93. </if>
  94. <if test="version !=null">
  95. and version = #{version}
  96. </if>
  97. <if test="houseId !=null">
  98. and houseId = #{houseId}
  99. </if>
  100. <if test="eatScore !=null">
  101. and eatScore = #{eatScore}
  102. </if>
  103. <if test="fileUuid !=null">
  104. and file_uuid = #{fileUuid}
  105. </if>
  106. </where>
  107. <choose>
  108. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  109. ORDER BY ${page.orderBy}
  110. </when>
  111. <otherwise>
  112. </otherwise>
  113. </choose>
  114. </select>
  115. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  116. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfochecksFile">
  117. INSERT INTO daily_record_foodbasicinfochecks_file
  118. <trim prefix="(" suffix=")" suffixOverrides=",">
  119. <!-- <if test=" id != null">
  120. id,
  121. </if>-->
  122. <if test=" uuid != null">
  123. uuid,
  124. </if>
  125. <if test=" foodbasicinfoId != null">
  126. foodbasicinfoId,
  127. </if>
  128. <if test=" checkTime != null">
  129. checkTime,
  130. </if>
  131. <if test=" water != null">
  132. water,
  133. </if>
  134. <if test=" boldfat != null">
  135. boldfat,
  136. </if>
  137. <if test=" glutenWater != null">
  138. glutenWater,
  139. </if>
  140. <if test=" checker != null">
  141. checker,
  142. </if>
  143. <if test=" cId != null">
  144. cId,
  145. </if>
  146. <if test=" uId != null">
  147. uId,
  148. </if>
  149. <if test=" cTime != null">
  150. cTime,
  151. </if>
  152. <if test=" uTime != null">
  153. uTime,
  154. </if>
  155. <if test=" version != null">
  156. version,
  157. </if>
  158. <if test=" houseId != null">
  159. houseId,
  160. </if>
  161. <if test=" eatScore != null">
  162. eatScore,
  163. </if>
  164. <if test=" fileUuid != null">
  165. file_uuid
  166. </if>
  167. </trim>
  168. <trim prefix="values (" suffix=")" suffixOverrides=",">
  169. <!--<if test="id !=null">
  170. #{id},
  171. </if>-->
  172. <if test=" uuid != null">
  173. #{uuid}, </if>
  174. <if test=" foodbasicinfoId != null">
  175. #{foodbasicinfoId}, </if>
  176. <if test=" checkTime != null">
  177. #{checkTime}, </if>
  178. <if test=" water != null">
  179. #{water}, </if>
  180. <if test=" boldfat != null">
  181. #{boldfat}, </if>
  182. <if test=" glutenWater != null">
  183. #{glutenWater}, </if>
  184. <if test=" checker != null">
  185. #{checker}, </if>
  186. <if test=" cId != null">
  187. #{cId}, </if>
  188. <if test=" uId != null">
  189. #{uId}, </if>
  190. <if test=" cTime != null">
  191. #{cTime}, </if>
  192. <if test=" uTime != null">
  193. #{uTime}, </if>
  194. <if test=" version != null">
  195. #{version}, </if>
  196. <if test=" houseId != null">
  197. #{houseId}, </if>
  198. <if test=" eatScore != null">
  199. #{eatScore}, </if>
  200. <if test=" fileUuid != null">
  201. #{fileUuid}</if>
  202. </trim>
  203. </insert>
  204. </mapper>