RecordMedicineApplyNewMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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.entity.new_entity.RecordMedicineApplyNewMapper" >
  4. <resultMap id="BaseResultMap" type="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNew" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="grain_id" property="grainId" jdbcType="INTEGER" />
  7. <result column="code" property="code" jdbcType="VARCHAR" />
  8. <result column="use_date" property="useDate" jdbcType="VARCHAR" />
  9. <result column="name" property="name" jdbcType="VARCHAR" />
  10. <result column="number" property="number" jdbcType="INTEGER" />
  11. <result column="purpose" property="purpose" jdbcType="VARCHAR" />
  12. <result column="med_ocde" property="medOcde" jdbcType="VARCHAR" />
  13. <result column="use_user" property="useUser" jdbcType="VARCHAR" />
  14. <result column="chief" property="chief" jdbcType="VARCHAR" />
  15. <result column="chief_state" property="chiefState" jdbcType="VARCHAR" />
  16. <result column="head_idea" property="headIdea" jdbcType="VARCHAR" />
  17. <result column="head_state" property="headState" jdbcType="VARCHAR" />
  18. <result column="remark" property="remark" jdbcType="VARCHAR" />
  19. <result column="uuid" property="uuid" jdbcType="VARCHAR" />
  20. <result column="c_id" property="cId" jdbcType="INTEGER" />
  21. <result column="c_time" property="cTime" jdbcType="TIMESTAMP" />
  22. <result column="u_id" property="uId" jdbcType="INTEGER" />
  23. <result column="u_time" property="uTime" jdbcType="TIMESTAMP" />
  24. <result column="state" property="state" jdbcType="VARCHAR" />
  25. </resultMap>
  26. <sql id="Example_Where_Clause" >
  27. <where >
  28. <foreach collection="oredCriteria" item="criteria" separator="or" >
  29. <if test="criteria.valid" >
  30. <trim prefix="(" suffix=")" prefixOverrides="and" >
  31. <foreach collection="criteria.criteria" item="criterion" >
  32. <choose >
  33. <when test="criterion.noValue" >
  34. and ${criterion.condition}
  35. </when>
  36. <when test="criterion.singleValue" >
  37. and ${criterion.condition} #{criterion.value}
  38. </when>
  39. <when test="criterion.betweenValue" >
  40. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  41. </when>
  42. <when test="criterion.listValue" >
  43. and ${criterion.condition}
  44. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  45. #{listItem}
  46. </foreach>
  47. </when>
  48. </choose>
  49. </foreach>
  50. </trim>
  51. </if>
  52. </foreach>
  53. </where>
  54. </sql>
  55. <sql id="Update_By_Example_Where_Clause" >
  56. <where >
  57. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  58. <if test="criteria.valid" >
  59. <trim prefix="(" suffix=")" prefixOverrides="and" >
  60. <foreach collection="criteria.criteria" item="criterion" >
  61. <choose >
  62. <when test="criterion.noValue" >
  63. and ${criterion.condition}
  64. </when>
  65. <when test="criterion.singleValue" >
  66. and ${criterion.condition} #{criterion.value}
  67. </when>
  68. <when test="criterion.betweenValue" >
  69. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  70. </when>
  71. <when test="criterion.listValue" >
  72. and ${criterion.condition}
  73. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  74. #{listItem}
  75. </foreach>
  76. </when>
  77. </choose>
  78. </foreach>
  79. </trim>
  80. </if>
  81. </foreach>
  82. </where>
  83. </sql>
  84. <sql id="Base_Column_List" >
  85. id, grain_id, code, use_date, name, number, purpose, med_ocde, use_user, chief, chief_state,
  86. head_idea, head_state, remark, c_id, c_time, u_id, u_time, state
  87. </sql>
  88. <select id="selectByExample" resultMap="BaseResultMap" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNewExample" >
  89. select
  90. <if test="distinct" >
  91. distinct
  92. </if>
  93. <include refid="Base_Column_List" />
  94. from record_medicine_apply_new
  95. <if test="_parameter != null" >
  96. <include refid="Example_Where_Clause" />
  97. </if>
  98. <if test="orderByClause != null" >
  99. order by ${orderByClause}
  100. </if>
  101. </select>
  102. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  103. select
  104. <include refid="Base_Column_List" />
  105. from record_medicine_apply_new
  106. where id = #{id,jdbcType=INTEGER}
  107. </select>
  108. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  109. delete from record_medicine_apply_new
  110. where id = #{id,jdbcType=INTEGER}
  111. </delete>
  112. <delete id="deleteByExample" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNewExample" >
  113. delete from record_medicine_apply_new
  114. <if test="_parameter != null" >
  115. <include refid="Example_Where_Clause" />
  116. </if>
  117. </delete>
  118. <insert id="insert" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNew" >
  119. insert into record_medicine_apply_new (id, grain_id, code,
  120. use_date, name, number,
  121. purpose, med_ocde, use_user,
  122. chief, chief_state, head_idea,
  123. head_state, remark, c_id,
  124. c_time, u_id, u_time,
  125. state)
  126. values (#{id,jdbcType=INTEGER}, #{grainId,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR},
  127. #{useDate,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER},
  128. #{purpose,jdbcType=VARCHAR}, #{medOcde,jdbcType=VARCHAR}, #{useUser,jdbcType=VARCHAR},
  129. #{chief,jdbcType=VARCHAR}, #{chiefState,jdbcType=VARCHAR}, #{headIdea,jdbcType=VARCHAR},
  130. #{headState,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{cId,jdbcType=INTEGER},
  131. #{cTime,jdbcType=TIMESTAMP}, #{uId,jdbcType=INTEGER}, #{uTime,jdbcType=TIMESTAMP},
  132. #{state,jdbcType=VARCHAR})
  133. </insert>
  134. <insert id="insertSelective" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNew" >
  135. insert into record_medicine_apply_new
  136. <trim prefix="(" suffix=")" suffixOverrides="," >
  137. <if test="id != null" >
  138. id,
  139. </if>
  140. <if test="grainId != null" >
  141. grain_id,
  142. </if>
  143. <if test="code != null" >
  144. code,
  145. </if>
  146. <if test="useDate != null" >
  147. use_date,
  148. </if>
  149. <if test="name != null" >
  150. name,
  151. </if>
  152. <if test="number != null" >
  153. number,
  154. </if>
  155. <if test="purpose != null" >
  156. purpose,
  157. </if>
  158. <if test="medOcde != null" >
  159. med_ocde,
  160. </if>
  161. <if test="useUser != null" >
  162. use_user,
  163. </if>
  164. <if test="chief != null" >
  165. chief,
  166. </if>
  167. <if test="chiefState != null" >
  168. chief_state,
  169. </if>
  170. <if test="headIdea != null" >
  171. head_idea,
  172. </if>
  173. <if test="headState != null" >
  174. head_state,
  175. </if>
  176. <if test="remark != null" >
  177. remark,
  178. </if>
  179. <if test="cId != null" >
  180. c_id,
  181. </if>
  182. <if test="cTime != null" >
  183. c_time,
  184. </if>
  185. <if test="uId != null" >
  186. u_id,
  187. </if>
  188. <if test="uTime != null" >
  189. u_time,
  190. </if>
  191. <if test="state != null" >
  192. state,
  193. </if>
  194. </trim>
  195. <trim prefix="values (" suffix=")" suffixOverrides="," >
  196. <if test="id != null" >
  197. #{id,jdbcType=INTEGER},
  198. </if>
  199. <if test="grainId != null" >
  200. #{grainId,jdbcType=INTEGER},
  201. </if>
  202. <if test="code != null" >
  203. #{code,jdbcType=VARCHAR},
  204. </if>
  205. <if test="useDate != null" >
  206. #{useDate,jdbcType=VARCHAR},
  207. </if>
  208. <if test="name != null" >
  209. #{name,jdbcType=VARCHAR},
  210. </if>
  211. <if test="number != null" >
  212. #{number,jdbcType=INTEGER},
  213. </if>
  214. <if test="purpose != null" >
  215. #{purpose,jdbcType=VARCHAR},
  216. </if>
  217. <if test="medOcde != null" >
  218. #{medOcde,jdbcType=VARCHAR},
  219. </if>
  220. <if test="useUser != null" >
  221. #{useUser,jdbcType=VARCHAR},
  222. </if>
  223. <if test="chief != null" >
  224. #{chief,jdbcType=VARCHAR},
  225. </if>
  226. <if test="chiefState != null" >
  227. #{chiefState,jdbcType=VARCHAR},
  228. </if>
  229. <if test="headIdea != null" >
  230. #{headIdea,jdbcType=VARCHAR},
  231. </if>
  232. <if test="headState != null" >
  233. #{headState,jdbcType=VARCHAR},
  234. </if>
  235. <if test="remark != null" >
  236. #{remark,jdbcType=VARCHAR},
  237. </if>
  238. <if test="cId != null" >
  239. #{cId,jdbcType=INTEGER},
  240. </if>
  241. <if test="cTime != null" >
  242. #{cTime,jdbcType=TIMESTAMP},
  243. </if>
  244. <if test="uId != null" >
  245. #{uId,jdbcType=INTEGER},
  246. </if>
  247. <if test="uTime != null" >
  248. #{uTime,jdbcType=TIMESTAMP},
  249. </if>
  250. <if test="state != null" >
  251. #{state,jdbcType=VARCHAR},
  252. </if>
  253. </trim>
  254. </insert>
  255. <select id="countByExample" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNewExample" resultType="java.lang.Integer" >
  256. select count(*) from record_medicine_apply_new
  257. <if test="_parameter != null" >
  258. <include refid="Example_Where_Clause" />
  259. </if>
  260. </select>
  261. <update id="updateByExampleSelective" parameterType="map" >
  262. update record_medicine_apply_new
  263. <set >
  264. <if test="record.id != null" >
  265. id = #{record.id,jdbcType=INTEGER},
  266. </if>
  267. <if test="record.grainId != null" >
  268. grain_id = #{record.grainId,jdbcType=INTEGER},
  269. </if>
  270. <if test="record.code != null" >
  271. code = #{record.code,jdbcType=VARCHAR},
  272. </if>
  273. <if test="record.useDate != null" >
  274. use_date = #{record.useDate,jdbcType=VARCHAR},
  275. </if>
  276. <if test="record.name != null" >
  277. name = #{record.name,jdbcType=VARCHAR},
  278. </if>
  279. <if test="record.number != null" >
  280. number = #{record.number,jdbcType=INTEGER},
  281. </if>
  282. <if test="record.purpose != null" >
  283. purpose = #{record.purpose,jdbcType=VARCHAR},
  284. </if>
  285. <if test="record.medOcde != null" >
  286. med_ocde = #{record.medOcde,jdbcType=VARCHAR},
  287. </if>
  288. <if test="record.useUser != null" >
  289. use_user = #{record.useUser,jdbcType=VARCHAR},
  290. </if>
  291. <if test="record.chief != null" >
  292. chief = #{record.chief,jdbcType=VARCHAR},
  293. </if>
  294. <if test="record.chiefState != null" >
  295. chief_state = #{record.chiefState,jdbcType=VARCHAR},
  296. </if>
  297. <if test="record.headIdea != null" >
  298. head_idea = #{record.headIdea,jdbcType=VARCHAR},
  299. </if>
  300. <if test="record.headState != null" >
  301. head_state = #{record.headState,jdbcType=VARCHAR},
  302. </if>
  303. <if test="record.remark != null" >
  304. remark = #{record.remark,jdbcType=VARCHAR},
  305. </if>
  306. <if test="record.cId != null" >
  307. c_id = #{record.cId,jdbcType=INTEGER},
  308. </if>
  309. <if test="record.cTime != null" >
  310. c_time = #{record.cTime,jdbcType=TIMESTAMP},
  311. </if>
  312. <if test="record.uId != null" >
  313. u_id = #{record.uId,jdbcType=INTEGER},
  314. </if>
  315. <if test="record.uTime != null" >
  316. u_time = #{record.uTime,jdbcType=TIMESTAMP},
  317. </if>
  318. <if test="record.state != null" >
  319. state = #{record.state,jdbcType=VARCHAR},
  320. </if>
  321. </set>
  322. <if test="_parameter != null" >
  323. <include refid="Update_By_Example_Where_Clause" />
  324. </if>
  325. </update>
  326. <update id="updateByExample" parameterType="map" >
  327. update record_medicine_apply_new
  328. set id = #{record.id,jdbcType=INTEGER},
  329. grain_id = #{record.grainId,jdbcType=INTEGER},
  330. code = #{record.code,jdbcType=VARCHAR},
  331. use_date = #{record.useDate,jdbcType=VARCHAR},
  332. name = #{record.name,jdbcType=VARCHAR},
  333. number = #{record.number,jdbcType=INTEGER},
  334. purpose = #{record.purpose,jdbcType=VARCHAR},
  335. med_ocde = #{record.medOcde,jdbcType=VARCHAR},
  336. use_user = #{record.useUser,jdbcType=VARCHAR},
  337. chief = #{record.chief,jdbcType=VARCHAR},
  338. chief_state = #{record.chiefState,jdbcType=VARCHAR},
  339. head_idea = #{record.headIdea,jdbcType=VARCHAR},
  340. head_state = #{record.headState,jdbcType=VARCHAR},
  341. remark = #{record.remark,jdbcType=VARCHAR},
  342. c_id = #{record.cId,jdbcType=INTEGER},
  343. c_time = #{record.cTime,jdbcType=TIMESTAMP},
  344. u_id = #{record.uId,jdbcType=INTEGER},
  345. u_time = #{record.uTime,jdbcType=TIMESTAMP},
  346. state = #{record.state,jdbcType=VARCHAR}
  347. <if test="_parameter != null" >
  348. <include refid="Update_By_Example_Where_Clause" />
  349. </if>
  350. </update>
  351. <update id="updateByPrimaryKeySelective" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNew" >
  352. update record_medicine_apply_new
  353. <set >
  354. <if test="grainId != null" >
  355. grain_id = #{grainId,jdbcType=INTEGER},
  356. </if>
  357. <if test="code != null" >
  358. code = #{code,jdbcType=VARCHAR},
  359. </if>
  360. <if test="useDate != null" >
  361. use_date = #{useDate,jdbcType=VARCHAR},
  362. </if>
  363. <if test="name != null" >
  364. name = #{name,jdbcType=VARCHAR},
  365. </if>
  366. <if test="number != null" >
  367. number = #{number,jdbcType=INTEGER},
  368. </if>
  369. <if test="purpose != null" >
  370. purpose = #{purpose,jdbcType=VARCHAR},
  371. </if>
  372. <if test="medOcde != null" >
  373. med_ocde = #{medOcde,jdbcType=VARCHAR},
  374. </if>
  375. <if test="useUser != null" >
  376. use_user = #{useUser,jdbcType=VARCHAR},
  377. </if>
  378. <if test="chief != null" >
  379. chief = #{chief,jdbcType=VARCHAR},
  380. </if>
  381. <if test="chiefState != null" >
  382. chief_state = #{chiefState,jdbcType=VARCHAR},
  383. </if>
  384. <if test="headIdea != null" >
  385. head_idea = #{headIdea,jdbcType=VARCHAR},
  386. </if>
  387. <if test="headState != null" >
  388. head_state = #{headState,jdbcType=VARCHAR},
  389. </if>
  390. <if test="remark != null" >
  391. remark = #{remark,jdbcType=VARCHAR},
  392. </if>
  393. <if test="cId != null" >
  394. c_id = #{cId,jdbcType=INTEGER},
  395. </if>
  396. <if test="cTime != null" >
  397. c_time = #{cTime,jdbcType=TIMESTAMP},
  398. </if>
  399. <if test="uId != null" >
  400. u_id = #{uId,jdbcType=INTEGER},
  401. </if>
  402. <if test="uTime != null" >
  403. u_time = #{uTime,jdbcType=TIMESTAMP},
  404. </if>
  405. <if test="state != null" >
  406. state = #{state,jdbcType=VARCHAR},
  407. </if>
  408. </set>
  409. where id = #{id,jdbcType=INTEGER}
  410. </update>
  411. <update id="updateByPrimaryKey" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApplyNew" >
  412. update record_medicine_apply_new
  413. set grain_id = #{grainId,jdbcType=INTEGER},
  414. code = #{code,jdbcType=VARCHAR},
  415. use_date = #{useDate,jdbcType=VARCHAR},
  416. name = #{name,jdbcType=VARCHAR},
  417. number = #{number,jdbcType=INTEGER},
  418. purpose = #{purpose,jdbcType=VARCHAR},
  419. med_ocde = #{medOcde,jdbcType=VARCHAR},
  420. use_user = #{useUser,jdbcType=VARCHAR},
  421. chief = #{chief,jdbcType=VARCHAR},
  422. chief_state = #{chiefState,jdbcType=VARCHAR},
  423. head_idea = #{headIdea,jdbcType=VARCHAR},
  424. head_state = #{headState,jdbcType=VARCHAR},
  425. remark = #{remark,jdbcType=VARCHAR},
  426. c_id = #{cId,jdbcType=INTEGER},
  427. c_time = #{cTime,jdbcType=TIMESTAMP},
  428. u_id = #{uId,jdbcType=INTEGER},
  429. u_time = #{uTime,jdbcType=TIMESTAMP},
  430. state = #{state,jdbcType=VARCHAR}
  431. where id = #{id,jdbcType=INTEGER}
  432. </update>
  433. </mapper>