BdglAntiepidemicPutinMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.medicalhealth.mapper.BdglAntiepidemicPutinMapper">
  6. <resultMap type="BdglAntiepidemicPutin" id="BdglAntiepidemicPutinResult">
  7. <result property="id" column="id" />
  8. <result property="durgArchivesId" column="durg_archives_id" />
  9. <result property="putIn" column="put_in" />
  10. <result property="place" column="place" />
  11. <result property="putTime" column="put_time" />
  12. <result property="adminId" column="admin_id" />
  13. <result property="createtime" column="createtime" />
  14. <result property="updatetime" column="updatetime" />
  15. <result property="durgBrand" column="durg_brand" />
  16. <result property="specifications" column="specifications" />
  17. <result property="unitId" column="unit_id" />
  18. <result property="storeHouse" column="store_house" />
  19. <result property="durgName" column="durg_name" />
  20. <result property="unitName" column="unit_name" />
  21. <result property="expirationTime" column="expiration_time" />
  22. <result property="putNumber" column="put_number" />
  23. <result property="state" column="state" />
  24. <result property="expiredstatus" column="expiredstatus" />
  25. <result property="beizhu" column="beizhu" />
  26. <result property="surplus" column="surplus" />
  27. </resultMap>
  28. <sql id="selectBdglAntiepidemicPutinVo">
  29. select id, durg_archives_id, put_in, place, put_time, admin_id, createtime, updatetime, durg_brand, specifications, unit_id, store_house, durg_name, unit_name, expiration_time, put_number, state, expiredstatus, beizhu,surplus from bdgl_antiepidemic_putin
  30. </sql>
  31. <select id="selectBdglAntiepidemicPutinList" parameterType="BdglAntiepidemicPutin" resultMap="BdglAntiepidemicPutinResult">
  32. <include refid="selectBdglAntiepidemicPutinVo"/>
  33. <where>
  34. <if test="durgArchivesId != null "> and durg_archives_id = #{durgArchivesId}</if>
  35. <if test="putIn != null "> and put_in = #{putIn}</if>
  36. <if test="place != null and place != ''"> and place = #{place}</if>
  37. <if test="putTime != null "> and put_time = #{putTime}</if>
  38. <if test="adminId != null "> and admin_id = #{adminId}</if>
  39. <if test="createtime != null "> and createtime = #{createtime}</if>
  40. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  41. <if test="durgBrand != null and durgBrand != ''"> and durg_brand = #{durgBrand}</if>
  42. <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
  43. <if test="unitId != null "> and unit_id = #{unitId}</if>
  44. <if test="storeHouse != null "> and store_house = #{storeHouse}</if>
  45. <if test="durgName != null and durgName != ''"> and durg_name like concat('%', #{durgName}, '%')</if>
  46. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  47. <if test="expirationTime != null "> and expiration_time = #{expirationTime}</if>
  48. <if test="putNumber != null and putNumber != ''"> and put_number = #{putNumber}</if>
  49. <if test="state != null and state != ''"> and state = #{state}</if>
  50. <if test="expiredstatus != null and expiredstatus != ''"> and expiredstatus = #{expiredstatus}</if>
  51. <if test="beizhu != null and beizhu != ''"> and beizhu = #{beizhu}</if>
  52. <if test="surplus != null "> and surplus = #{surplus}</if>
  53. </where>
  54. </select>
  55. <select id="sselectGuoQi" resultMap="BdglAntiepidemicPutinResult">
  56. <include refid="selectBdglAntiepidemicPutinVo"/>
  57. <where>
  58. <if test="durgArchivesId != null "> and durg_archives_id = #{durgArchivesId}</if>
  59. <if test="putIn != null "> and put_in = #{putIn}</if>
  60. <if test="place != null and place != ''"> and place = #{place}</if>
  61. <if test="putTime != null "> and put_time = #{putTime}</if>
  62. <if test="adminId != null "> and admin_id = #{adminId}</if>
  63. <if test="createtime != null "> and createtime = #{createtime}</if>
  64. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  65. <if test="durgBrand != null and durgBrand != ''"> and durg_brand = #{durgBrand}</if>
  66. <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
  67. <if test="unitId != null "> and unit_id = #{unitId}</if>
  68. <if test="surplus != null "> and surplus = #{surplus}</if>
  69. <if test="storeHouse != null "> and store_house = #{storeHouse}</if>
  70. <if test="durgName != null and durgName != ''"> and durg_name like concat('%', #{durgName}, '%')</if>
  71. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  72. <if test="expirationTime != null "> and
  73. <![CDATA[ expiration_time <= #{expirationTime}]]>
  74. </if>
  75. <if test="putNumber != null and putNumber != ''"> and put_number = #{putNumber}</if>
  76. and state='0'
  77. </where>
  78. </select>
  79. <select id="selectBdglAntiepidemicPutinById" parameterType="Long" resultMap="BdglAntiepidemicPutinResult">
  80. <include refid="selectBdglAntiepidemicPutinVo"/>
  81. where id = #{id}
  82. </select>
  83. <select id="selectBdglDurgPutinListweiGuoQi" resultMap="BdglAntiepidemicPutinResult">
  84. <include refid="selectBdglAntiepidemicPutinVo"/>
  85. <where>
  86. <if test="durgArchivesId != null "> and durg_archives_id = #{durgArchivesId}</if>
  87. <if test="putIn != null "> and put_in = #{putIn}</if>
  88. <if test="place != null and place != ''"> and place = #{place}</if>
  89. <if test="putTime != null "> and put_time = #{putTime}</if>
  90. <if test="adminId != null "> and admin_id = #{adminId}</if>
  91. <if test="createtime != null "> and createtime = #{createtime}</if>
  92. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  93. <if test="durgBrand != null and durgBrand != ''"> and durg_brand = #{durgBrand}</if>
  94. <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
  95. <if test="unitId != null "> and unit_id = #{unitId}</if>
  96. <if test="surplus != null "> and surplus = #{surplus}</if>
  97. <if test="storeHouse != null "> and store_house = #{storeHouse}</if>
  98. <if test="durgName != null and durgName != ''"> and durg_name like concat('%', #{durgName}, '%')</if>
  99. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  100. <if test="expirationTime != null "> and
  101. <![CDATA[ expiration_time > #{expirationTime}]]>
  102. </if>
  103. <if test="putNumber != null and putNumber != ''"> and put_number = #{putNumber}</if>
  104. and state='0'
  105. </where>
  106. </select>
  107. <insert id="insertBdglAntiepidemicPutin" parameterType="BdglAntiepidemicPutin" useGeneratedKeys="true" keyProperty="id">
  108. insert into bdgl_antiepidemic_putin
  109. <trim prefix="(" suffix=")" suffixOverrides=",">
  110. <if test="durgArchivesId != null">durg_archives_id,</if>
  111. <if test="putIn != null">put_in,</if>
  112. <if test="place != null">place,</if>
  113. <if test="putTime != null">put_time,</if>
  114. <if test="adminId != null">admin_id,</if>
  115. <if test="createtime != null">createtime,</if>
  116. <if test="updatetime != null">updatetime,</if>
  117. <if test="durgBrand != null">durg_brand,</if>
  118. <if test="specifications != null">specifications,</if>
  119. <if test="unitId != null">unit_id,</if>
  120. <if test="storeHouse != null">store_house,</if>
  121. <if test="durgName != null">durg_name,</if>
  122. <if test="unitName != null">unit_name,</if>
  123. <if test="expirationTime != null">expiration_time,</if>
  124. <if test="putNumber != null">put_number,</if>
  125. <if test="state != null">state,</if>
  126. <if test="expiredstatus != null">expiredstatus,</if>
  127. <if test="beizhu != null">beizhu,</if>
  128. <if test="surplus != null">surplus,</if>
  129. </trim>
  130. <trim prefix="values (" suffix=")" suffixOverrides=",">
  131. <if test="durgArchivesId != null">#{durgArchivesId},</if>
  132. <if test="putIn != null">#{putIn},</if>
  133. <if test="place != null">#{place},</if>
  134. <if test="putTime != null">#{putTime},</if>
  135. <if test="adminId != null">#{adminId},</if>
  136. <if test="createtime != null">#{createtime},</if>
  137. <if test="updatetime != null">#{updatetime},</if>
  138. <if test="durgBrand != null">#{durgBrand},</if>
  139. <if test="specifications != null">#{specifications},</if>
  140. <if test="unitId != null">#{unitId},</if>
  141. <if test="storeHouse != null">#{storeHouse},</if>
  142. <if test="durgName != null">#{durgName},</if>
  143. <if test="unitName != null">#{unitName},</if>
  144. <if test="expirationTime != null">#{expirationTime},</if>
  145. <if test="putNumber != null">#{putNumber},</if>
  146. <if test="state != null">#{state},</if>
  147. <if test="expiredstatus != null">#{expiredstatus},</if>
  148. <if test="beizhu != null">#{beizhu},</if>
  149. <if test="surplus != null">#{surplus},</if>
  150. </trim>
  151. </insert>
  152. <update id="updateBdglAntiepidemicPutin" parameterType="BdglAntiepidemicPutin">
  153. update bdgl_antiepidemic_putin
  154. <trim prefix="SET" suffixOverrides=",">
  155. <if test="durgArchivesId != null">durg_archives_id = #{durgArchivesId},</if>
  156. <if test="putIn != null">put_in = #{putIn},</if>
  157. <if test="place != null">place = #{place},</if>
  158. <if test="putTime != null">put_time = #{putTime},</if>
  159. <if test="adminId != null">admin_id = #{adminId},</if>
  160. <if test="createtime != null">createtime = #{createtime},</if>
  161. <if test="updatetime != null">updatetime = #{updatetime},</if>
  162. <if test="durgBrand != null">durg_brand = #{durgBrand},</if>
  163. <if test="specifications != null">specifications = #{specifications},</if>
  164. <if test="unitId != null">unit_id = #{unitId},</if>
  165. <if test="storeHouse != null">store_house = #{storeHouse},</if>
  166. <if test="durgName != null">durg_name = #{durgName},</if>
  167. <if test="unitName != null">unit_name = #{unitName},</if>
  168. <if test="expirationTime != null">expiration_time = #{expirationTime},</if>
  169. <if test="putNumber != null">put_number = #{putNumber},</if>
  170. <if test="state != null">state = #{state},</if>
  171. <if test="expiredstatus != null">expiredstatus = #{expiredstatus},</if>
  172. <if test="beizhu != null">beizhu = #{beizhu},</if>
  173. <if test="surplus != null">surplus = #{surplus},</if>
  174. </trim>
  175. where id = #{id}
  176. </update>
  177. <delete id="deleteBdglAntiepidemicPutinById" parameterType="Long">
  178. delete from bdgl_antiepidemic_putin where id = #{id}
  179. </delete>
  180. <delete id="deleteBdglAntiepidemicPutinByIds" parameterType="String">
  181. delete from bdgl_antiepidemic_putin where id in
  182. <foreach item="id" collection="array" open="(" separator="," close=")">
  183. #{id}
  184. </foreach>
  185. </delete>
  186. </mapper>