DailyRecordFoodbasicinfochecksDao.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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.DailyRecordFoodbasicinfochecksDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfochecks" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="foodbasicinfoId" property="foodbasicinfoId"/>
  7. <result column="checkTime" property="checkTime"/>
  8. <result column="water" property="water"/>
  9. <result column="boldfat" property="boldfat"/>
  10. <result column="glutenWater" property="glutenWater"/>
  11. <result column="checker" property="checker"/>
  12. <result column="cId" property="cId"/>
  13. <result column="uId" property="uId"/>
  14. <result column="cTime" property="cTime"/>
  15. <result column="uTime" property="uTime"/>
  16. <result column="version" property="version"/>
  17. <result column="houseId" property="houseId"/>
  18. <result column="eatScore" property="eatScore"/>
  19. </resultMap>
  20. <sql id="columns">
  21. id ,
  22. foodbasicinfoId ,
  23. checkTime ,
  24. water ,
  25. boldfat ,
  26. glutenWater ,
  27. checker ,
  28. cId ,
  29. uId ,
  30. cTime ,
  31. uTime ,
  32. version ,
  33. houseId ,
  34. eatScore
  35. </sql>
  36. <sql id="joinCols">
  37. </sql>
  38. <select id="get" resultMap="baseMap">
  39. SELECT
  40. <include refid="columns"/>
  41. FROM daily_record_foodbasicinfochecks a
  42. <include refid="joinCols"/>
  43. WHERE a.id = #{id}
  44. </select>
  45. <select id="findList" resultMap="baseMap">
  46. SELECT
  47. <include refid="columns"/>
  48. FROM daily_record_foodbasicinfochecks a
  49. <include refid="joinCols"/>
  50. <where>
  51. <if test="id !=null">
  52. and id = #{id}
  53. </if>
  54. <if test="foodbasicinfoId !=null">
  55. and foodbasicinfoId = #{foodbasicinfoId}
  56. </if>
  57. <if test="checkTime !=null">
  58. and checkTime = #{checkTime}
  59. </if>
  60. <if test="water !=null">
  61. and water = #{water}
  62. </if>
  63. <if test="boldfat !=null">
  64. and boldfat = #{boldfat}
  65. </if>
  66. <if test="glutenWater !=null">
  67. and glutenWater = #{glutenWater}
  68. </if>
  69. <if test="checker !=null">
  70. and checker = #{checker}
  71. </if>
  72. <if test="cId !=null">
  73. and cId = #{cId}
  74. </if>
  75. <if test="uId !=null">
  76. and uId = #{uId}
  77. </if>
  78. <if test="cTime !=null">
  79. and cTime = #{cTime}
  80. </if>
  81. <if test="uTime !=null">
  82. and uTime = #{uTime}
  83. </if>
  84. <if test="version !=null">
  85. and version = #{version}
  86. </if>
  87. <if test="houseId !=null">
  88. and houseId = #{houseId}
  89. </if>
  90. <if test="eatScore !=null">
  91. and eatScore = #{eatScore}
  92. </if>
  93. </where>
  94. <choose>
  95. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  96. ORDER BY ${page.orderBy}
  97. </when>
  98. <otherwise>
  99. </otherwise>
  100. </choose>
  101. </select>
  102. <select id="findAllList" resultMap="baseMap">
  103. SELECT
  104. <include refid="columns"/>
  105. FROM daily_record_foodbasicinfochecks a
  106. <include refid="joinCols"/>
  107. <where>
  108. <if test="id !=null">
  109. and id = #{id}
  110. </if>
  111. <if test="foodbasicinfoId !=null">
  112. and foodbasicinfoId = #{foodbasicinfoId}
  113. </if>
  114. <if test="checkTime !=null">
  115. and checkTime = #{checkTime}
  116. </if>
  117. <if test="water !=null">
  118. and water = #{water}
  119. </if>
  120. <if test="boldfat !=null">
  121. and boldfat = #{boldfat}
  122. </if>
  123. <if test="glutenWater !=null">
  124. and glutenWater = #{glutenWater}
  125. </if>
  126. <if test="checker !=null">
  127. and checker = #{checker}
  128. </if>
  129. <if test="cId !=null">
  130. and cId = #{cId}
  131. </if>
  132. <if test="uId !=null">
  133. and uId = #{uId}
  134. </if>
  135. <if test="cTime !=null">
  136. and cTime = #{cTime}
  137. </if>
  138. <if test="uTime !=null">
  139. and uTime = #{uTime}
  140. </if>
  141. <if test="version !=null">
  142. and version = #{version}
  143. </if>
  144. <if test="houseId !=null">
  145. and houseId = #{houseId}
  146. </if>
  147. <if test="eatScore !=null">
  148. and eatScore = #{eatScore}
  149. </if>
  150. </where>
  151. <choose>
  152. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  153. ORDER BY ${page.orderBy}
  154. </when>
  155. <otherwise>
  156. </otherwise>
  157. </choose>
  158. </select>
  159. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  160. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfochecks">
  161. INSERT INTO daily_record_foodbasicinfochecks
  162. <trim prefix="(" suffix=")" suffixOverrides=",">
  163. <if test=" id != null">
  164. id,
  165. </if>
  166. <if test=" foodbasicinfoId != null">
  167. foodbasicinfoId,
  168. </if>
  169. <if test=" checkTime != null">
  170. checkTime,
  171. </if>
  172. <if test=" water != null">
  173. water,
  174. </if>
  175. <if test=" boldfat != null">
  176. boldfat,
  177. </if>
  178. <if test=" glutenWater != null">
  179. glutenWater,
  180. </if>
  181. <if test=" checker != null">
  182. checker,
  183. </if>
  184. <if test=" cId != null">
  185. cId,
  186. </if>
  187. <if test=" uId != null">
  188. uId,
  189. </if>
  190. <if test=" cTime != null">
  191. cTime,
  192. </if>
  193. <if test=" uTime != null">
  194. uTime,
  195. </if>
  196. <if test=" version != null">
  197. version,
  198. </if>
  199. <if test=" houseId != null">
  200. houseId,
  201. </if>
  202. <if test=" eatScore != null">
  203. eatScore
  204. </if>
  205. </trim>
  206. <trim prefix="values (" suffix=")" suffixOverrides=",">
  207. <if test=" id != null">
  208. #{id}, </if>
  209. <if test=" foodbasicinfoId != null">
  210. #{foodbasicinfoId}, </if>
  211. <if test=" checkTime != null">
  212. #{checkTime}, </if>
  213. <if test=" water != null">
  214. #{water}, </if>
  215. <if test=" boldfat != null">
  216. #{boldfat}, </if>
  217. <if test=" glutenWater != null">
  218. #{glutenWater}, </if>
  219. <if test=" checker != null">
  220. #{checker}, </if>
  221. <if test=" cId != null">
  222. #{cId}, </if>
  223. <if test=" uId != null">
  224. #{uId}, </if>
  225. <if test=" cTime != null">
  226. #{cTime}, </if>
  227. <if test=" uTime != null">
  228. #{uTime}, </if>
  229. <if test=" version != null">
  230. #{version}, </if>
  231. <if test=" houseId != null">
  232. #{houseId}, </if>
  233. <if test=" eatScore != null">
  234. #{eatScore} </if>
  235. </trim>
  236. </insert>
  237. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfochecks">
  238. UPDATE daily_record_foodbasicinfochecks <set>
  239. <if test="id != null">
  240. id= #{id} ,
  241. </if>
  242. <if test="foodbasicinfoId != null">
  243. foodbasicinfoId= #{foodbasicinfoId} ,
  244. </if>
  245. <if test="checkTime != null">
  246. checkTime= #{checkTime} ,
  247. </if>
  248. <if test="water != null">
  249. water= #{water} ,
  250. </if>
  251. <if test="boldfat != null">
  252. boldfat= #{boldfat} ,
  253. </if>
  254. <if test="glutenWater != null">
  255. glutenWater= #{glutenWater} ,
  256. </if>
  257. <if test="checker != null">
  258. checker= #{checker} ,
  259. </if>
  260. <if test="cId != null">
  261. cId= #{cId} ,
  262. </if>
  263. <if test="uId != null">
  264. uId= #{uId} ,
  265. </if>
  266. <if test="cTime != null">
  267. cTime= #{cTime} ,
  268. </if>
  269. <if test="uTime != null">
  270. uTime= #{uTime} ,
  271. </if>
  272. <if test="version != null">
  273. version= #{version} ,
  274. </if>
  275. <if test="houseId != null">
  276. houseId= #{houseId} ,
  277. </if>
  278. <if test="eatScore != null">
  279. eatScore= #{eatScore}
  280. </if>
  281. </set>
  282. WHERE id = #{id}
  283. </update>
  284. <delete id="deleteById" parameterType="java.lang.Long">
  285. DELETE FROM daily_record_foodbasicinfochecks WHERE id = #{id}
  286. </delete>
  287. <delete id="deleteByIds" parameterType="java.util.List">
  288. DELETE FROM daily_record_foodbasicinfochecks WHERE id IN
  289. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  290. #{item}
  291. </foreach>
  292. </delete>
  293. <select id="findByHouseIdNoPage" resultMap="baseMap">
  294. SELECT *
  295. FROM daily_record_foodbasicinfochecks a
  296. where houseId=#{houseId}
  297. <if test="cTime != null">
  298. AND checkTime <![CDATA[ <= ]]> #{cTime}
  299. </if>
  300. </select>
  301. <delete id="deleteFoodbaseicInfochecksByHouseId">
  302. DELETE FROM daily_record_foodbasicinfochecks
  303. WHERE houseId = #{houseId}
  304. <if test="cTime != null">
  305. AND checkTime <![CDATA[ <= ]]> #{cTime}
  306. </if>
  307. </delete>
  308. </mapper>