MedicineGetDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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.dm.MedicineGetDao">
  4. <resultMap type="cn.ourwill.module.house.entity.dm.MedicineGet" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="houseId" property="houseId"/>
  7. <result column="name" property="name"/>
  8. <result column="thickness" property="thickness"/>
  9. <result column="count" property="count"/>
  10. <result column="department" property="department"/>
  11. <result column="getUser" property="getUser"/>
  12. <result column="getTime" property="getTime"/>
  13. <result column="useage" property="useage"/>
  14. <result column="handler" property="handler"/>
  15. <result column="remark" property="remark"/>
  16. <result column="cId" property="cId"/>
  17. <result column="uId" property="uId"/>
  18. <result column="cTime" property="cTime"/>
  19. <result column="provinceId" property="provinceId"/>
  20. <result column="cityId" property="cityId"/>
  21. <result column="grainId" property="grainId"/>
  22. </resultMap>
  23. <sql id="columns">
  24. id ,
  25. houseId ,
  26. name ,
  27. thickness ,
  28. `count` ,
  29. department ,
  30. getUser ,
  31. getTime ,
  32. useage ,
  33. handler ,
  34. remark ,
  35. cId ,
  36. uId ,
  37. cTime ,
  38. uTime ,
  39. uuid ,
  40. version,
  41. provinceId,
  42. cityId,
  43. grainId
  44. </sql>
  45. <sql id="joinCols">
  46. </sql>
  47. <select id="get" resultMap="baseMap">
  48. SELECT
  49. <include refid="columns"/>
  50. FROM dm_medicine_get a
  51. <include refid="joinCols"/>
  52. WHERE a.id = #{id}
  53. </select>
  54. <select id="findList" resultMap="baseMap">
  55. SELECT
  56. <include refid="columns"/>
  57. FROM dm_medicine_get a
  58. <include refid="joinCols"/>
  59. <where>
  60. <if test="id !=null">
  61. and id = #{id}
  62. </if>
  63. <if test="houseId !=null">
  64. and houseId = #{houseId}
  65. </if>
  66. <if test="name !=null">
  67. and `name` like CONCAT('%',#{name},'%')
  68. </if>
  69. <if test="thickness !=null">
  70. and thickness = #{thickness}
  71. </if>
  72. <if test="count !=null">
  73. and `count` = #{count}
  74. </if>
  75. <if test="department !=null">
  76. and department = #{department}
  77. </if>
  78. <if test="getUser !=null">
  79. and getUser = #{getUser}
  80. </if>
  81. <if test="getTime !=null">
  82. and getTime = #{getTime}
  83. </if>
  84. <if test="useage !=null">
  85. and useage = #{useage}
  86. </if>
  87. <if test="handler !=null">
  88. and handler = #{handler}
  89. </if>
  90. <if test="remark !=null">
  91. and remark = #{remark}
  92. </if>
  93. <if test="cId !=null">
  94. and cId = #{cId}
  95. </if>
  96. <if test="uId !=null">
  97. and uId = #{uId}
  98. </if>
  99. <if test="cTime !=null">
  100. and cTime = #{cTime}
  101. </if>
  102. <if test="uTime !=null">
  103. and uTime = #{uTime}
  104. </if>
  105. <if test="uuid !=null">
  106. and uuid = #{uuid}
  107. </if>
  108. <if test="version !=null">
  109. and version = #{version}
  110. </if>
  111. <if test="provinceId !=null">
  112. and provinceId = #{provinceId}
  113. </if>
  114. <if test="cityId !=null">
  115. and cityId = #{cityId}
  116. </if>
  117. <if test="grainId !=null">
  118. and grainId = #{grainId}
  119. </if>
  120. </where>
  121. <choose>
  122. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  123. ORDER BY ${page.orderBy}
  124. </when>
  125. <otherwise>
  126. </otherwise>
  127. </choose>
  128. </select>
  129. <select id="findAllList" resultMap="baseMap">
  130. SELECT
  131. <include refid="columns"/>
  132. FROM dm_medicine_get a
  133. <include refid="joinCols"/>
  134. <where>
  135. <if test="id !=null">
  136. and id = #{id}
  137. </if>
  138. <if test="houseId !=null">
  139. and houseId = #{houseId}
  140. </if>
  141. <if test="name !=null">
  142. and name = #{name}
  143. </if>
  144. <if test="thickness !=null">
  145. and thickness = #{thickness}
  146. </if>
  147. <if test="count !=null">
  148. and `count` = #{count}
  149. </if>
  150. <if test="department !=null">
  151. and department = #{department}
  152. </if>
  153. <if test="getUser !=null">
  154. and getUser = #{getUser}
  155. </if>
  156. <if test="getTime !=null">
  157. and getTime = #{getTime}
  158. </if>
  159. <if test="useage !=null">
  160. and useage = #{useage}
  161. </if>
  162. <if test="handler !=null">
  163. and handler = #{handler}
  164. </if>
  165. <if test="remark !=null">
  166. and remark = #{remark}
  167. </if>
  168. <if test="cId !=null">
  169. and cId = #{cId}
  170. </if>
  171. <if test="uId !=null">
  172. and uId = #{uId}
  173. </if>
  174. <if test="cTime !=null">
  175. and cTime = #{cTime}
  176. </if>
  177. <if test="uTime !=null">
  178. and uTime = #{uTime}
  179. </if>
  180. <if test="uuid !=null">
  181. and uuid = #{uuid}
  182. </if>
  183. <if test="version !=null">
  184. and version = #{version}
  185. </if>
  186. <if test="provinceId !=null">
  187. and provinceId = #{provinceId}
  188. </if>
  189. <if test="cityId !=null">
  190. and cityId = #{cityId}
  191. </if>
  192. <if test="grainId !=null">
  193. and grainId = #{grainId}
  194. </if>
  195. </where>
  196. <choose>
  197. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  198. ORDER BY ${page.orderBy}
  199. </when>
  200. <otherwise>
  201. </otherwise>
  202. </choose>
  203. </select>
  204. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  205. parameterType="cn.ourwill.module.house.entity.dm.MedicineGet">
  206. INSERT INTO dm_medicine_get
  207. <trim prefix="(" suffix=")" suffixOverrides=",">
  208. <if test=" id != null">
  209. id,
  210. </if>
  211. <if test=" houseId != null">
  212. houseId,
  213. </if>
  214. <if test=" name != null">
  215. `name`,
  216. </if>
  217. <if test=" thickness != null">
  218. thickness,
  219. </if>
  220. <if test=" count != null">
  221. `count`,
  222. </if>
  223. <if test=" department != null">
  224. department,
  225. </if>
  226. <if test=" getUser != null">
  227. getUser,
  228. </if>
  229. <if test=" getTime != null">
  230. getTime,
  231. </if>
  232. <if test=" useage != null">
  233. useage,
  234. </if>
  235. <if test=" handler != null">
  236. handler,
  237. </if>
  238. <if test=" remark != null">
  239. remark,
  240. </if>
  241. <if test=" cId != null">
  242. cId,
  243. </if>
  244. <if test=" uId != null">
  245. uId,
  246. </if>
  247. <if test=" cTime != null">
  248. cTime,
  249. </if>
  250. <if test=" uTime != null">
  251. uTime,
  252. </if>
  253. <if test=" uuid != null">
  254. uuid,
  255. </if>
  256. <if test=" version != null">
  257. version,
  258. </if>
  259. <if test=" provinceId != null">
  260. provinceId,
  261. </if>
  262. <if test=" cityId != null">
  263. cityId,
  264. </if>
  265. <if test=" grainId != null">
  266. grainId
  267. </if>
  268. </trim>
  269. <trim prefix="values (" suffix=")" suffixOverrides=",">
  270. <if test=" id != null">
  271. #{id}, </if>
  272. <if test=" houseId != null">
  273. #{houseId}, </if>
  274. <if test=" name != null">
  275. #{name}, </if>
  276. <if test=" thickness != null">
  277. #{thickness}, </if>
  278. <if test=" count != null">
  279. #{count}, </if>
  280. <if test=" department != null">
  281. #{department}, </if>
  282. <if test=" getUser != null">
  283. #{getUser}, </if>
  284. <if test=" getTime != null">
  285. #{getTime}, </if>
  286. <if test=" useage != null">
  287. #{useage}, </if>
  288. <if test=" handler != null">
  289. #{handler}, </if>
  290. <if test=" remark != null">
  291. #{remark}, </if>
  292. <if test=" cId != null">
  293. #{cId}, </if>
  294. <if test=" uId != null">
  295. #{uId}, </if>
  296. <if test=" cTime != null">
  297. #{cTime}, </if>
  298. <if test=" uTime != null">
  299. #{uTime}, </if>
  300. <if test=" uuid != null">
  301. #{uuid}, </if>
  302. <if test=" version != null">
  303. #{version} , </if>
  304. <if test=" provinceId != null">
  305. #{provinceId}, </if>
  306. <if test=" cityId != null">
  307. #{cityId}, </if>
  308. <if test=" grainId != null">
  309. #{grainId} </if>
  310. </trim>
  311. </insert>
  312. <update id="update" parameterType="cn.ourwill.module.house.entity.dm.MedicineGet">
  313. UPDATE dm_medicine_get <set>
  314. <if test="id != null">
  315. id= #{id} ,
  316. </if>
  317. <if test="houseId != null">
  318. houseId= #{houseId} ,
  319. </if>
  320. <if test="name != null">
  321. `name`= #{name} ,
  322. </if>
  323. <if test="thickness != null">
  324. thickness= #{thickness} ,
  325. </if>
  326. <if test="count != null">
  327. `count`= #{count} ,
  328. </if>
  329. <if test="department != null">
  330. department= #{department} ,
  331. </if>
  332. <if test="getUser != null">
  333. getUser= #{getUser} ,
  334. </if>
  335. <if test="getTime != null">
  336. getTime= #{getTime} ,
  337. </if>
  338. <if test="useage != null">
  339. useage= #{useage} ,
  340. </if>
  341. <if test="handler != null">
  342. handler= #{handler} ,
  343. </if>
  344. <if test="remark != null">
  345. remark= #{remark} ,
  346. </if>
  347. <if test="cId != null">
  348. cId= #{cId} ,
  349. </if>
  350. <if test="uId != null">
  351. uId= #{uId} ,
  352. </if>
  353. <if test="cTime != null">
  354. cTime= #{cTime} ,
  355. </if>
  356. <if test="uTime != null">
  357. uTime= #{uTime} ,
  358. </if>
  359. <if test="uuid != null">
  360. uuid= #{uuid} ,
  361. </if>
  362. <if test="version != null">
  363. version= #{version},
  364. </if>
  365. <if test="provinceId != null">
  366. provinceId= #{provinceId},
  367. </if>
  368. <if test="cityId != null">
  369. cityId= #{cityId},
  370. </if>
  371. <if test="grainId != null">
  372. grainId= #{grainId}
  373. </if>
  374. </set>
  375. WHERE id = #{id}
  376. </update>
  377. <delete id="deleteById" parameterType="java.lang.Long">
  378. DELETE FROM dm_medicine_get WHERE id = #{id}
  379. </delete>
  380. <delete id="deleteByIds" parameterType="java.util.List">
  381. DELETE FROM dm_medicine_get WHERE id IN
  382. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  383. #{item}
  384. </foreach>
  385. </delete>
  386. </mapper>