RecordMedicineCheckDao.xml 11 KB

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