BdglConsumeArchivesMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.BdglConsumeArchivesMapper">
  6. <resultMap type="BdglConsumeArchives" id="BdglConsumeArchivesResult">
  7. <result property="id" column="id" />
  8. <result property="durgName" column="durg_name" />
  9. <result property="durgBrand" column="durg_brand" />
  10. <result property="manufacturer" column="manufacturer" />
  11. <result property="specifications" column="specifications" />
  12. <result property="productIntroduction" column="product_introduction" />
  13. <result property="storeHouse" column="store_house" />
  14. <result property="unitId" column="unit_id" />
  15. <result property="amount" column="amount" />
  16. <result property="putIn" column="put_in" />
  17. <result property="putOut" column="put_out" />
  18. <result property="overdue" column="overdue" />
  19. <result property="remarks" column="remarks" />
  20. <result property="adminId" column="admin_id" />
  21. <result property="createTime" column="create_time" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="unitName" column="unit_name" />
  24. <result property="userName" column="user_name" />
  25. <result property="barCode" column="bar_code" />
  26. </resultMap>
  27. <sql id="selectBdglConsumeArchivesVo">
  28. select id, durg_name, durg_brand, manufacturer, specifications, product_introduction, store_house, unit_id, amount, put_in, put_out, overdue, remarks, admin_id, create_time, update_time, unit_name, user_name,bar_code from bdgl_consume_archives
  29. </sql>
  30. <select id="selectBdglConsumeArchivesList" parameterType="BdglConsumeArchives" resultMap="BdglConsumeArchivesResult">
  31. <include refid="selectBdglConsumeArchivesVo"/>
  32. <where>
  33. <if test="durgName != null and durgName != ''"> and durg_name like concat('%', #{durgName}, '%')</if>
  34. <if test="durgBrand != null and durgBrand != ''"> and durg_brand = #{durgBrand}</if>
  35. <if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
  36. <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
  37. <if test="productIntroduction != null and productIntroduction != ''"> and product_introduction = #{productIntroduction}</if>
  38. <if test="storeHouse != null "> and store_house = #{storeHouse}</if>
  39. <if test="unitId != null "> and unit_id = #{unitId}</if>
  40. <if test="amount != null "> and amount = #{amount}</if>
  41. <if test="putIn != null "> and put_in = #{putIn}</if>
  42. <if test="putOut != null "> and put_out = #{putOut}</if>
  43. <if test="overdue != null "> and overdue = #{overdue}</if>
  44. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  45. <if test="adminId != null "> and admin_id = #{adminId}</if>
  46. <if test="barCode != null "> and bar_code = #{barCode}</if>
  47. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  48. <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
  49. </where>
  50. </select>
  51. <select id="selectBdglConsumeArchivesById" parameterType="Long" resultMap="BdglConsumeArchivesResult">
  52. <include refid="selectBdglConsumeArchivesVo"/>
  53. where id = #{id}
  54. </select>
  55. <select id="selectBdglConsumeArchivesbynumber" parameterType="BdglConsumeArchives" resultMap="BdglConsumeArchivesResult">
  56. <include refid="selectBdglConsumeArchivesVo"/>
  57. where bar_code = #{barCode}
  58. </select>
  59. <insert id="insertBdglConsumeArchives" parameterType="BdglConsumeArchives" useGeneratedKeys="true" keyProperty="id">
  60. insert into bdgl_consume_archives
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="durgName != null">durg_name,</if>
  63. <if test="durgBrand != null">durg_brand,</if>
  64. <if test="manufacturer != null">manufacturer,</if>
  65. <if test="specifications != null">specifications,</if>
  66. <if test="productIntroduction != null">product_introduction,</if>
  67. <if test="storeHouse != null">store_house,</if>
  68. <if test="unitId != null">unit_id,</if>
  69. <if test="amount != null">amount,</if>
  70. <if test="putIn != null">put_in,</if>
  71. <if test="putOut != null">put_out,</if>
  72. <if test="overdue != null">overdue,</if>
  73. <if test="remarks != null">remarks,</if>
  74. <if test="adminId != null">admin_id,</if>
  75. <if test="createTime != null">create_time,</if>
  76. <if test="updateTime != null">update_time,</if>
  77. <if test="unitName != null">unit_name,</if>
  78. <if test="userName != null">user_name,</if>
  79. <if test="barCode != null">bar_code,</if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides=",">
  82. <if test="durgName != null">#{durgName},</if>
  83. <if test="durgBrand != null">#{durgBrand},</if>
  84. <if test="manufacturer != null">#{manufacturer},</if>
  85. <if test="specifications != null">#{specifications},</if>
  86. <if test="productIntroduction != null">#{productIntroduction},</if>
  87. <if test="storeHouse != null">#{storeHouse},</if>
  88. <if test="unitId != null">#{unitId},</if>
  89. <if test="amount != null">#{amount},</if>
  90. <if test="putIn != null">#{putIn},</if>
  91. <if test="putOut != null">#{putOut},</if>
  92. <if test="overdue != null">#{overdue},</if>
  93. <if test="remarks != null">#{remarks},</if>
  94. <if test="adminId != null">#{adminId},</if>
  95. <if test="createTime != null">#{createTime},</if>
  96. <if test="updateTime != null">#{updateTime},</if>
  97. <if test="unitName != null">#{unitName},</if>
  98. <if test="userName != null">#{userName},</if>
  99. <if test="barCode != null">#{barCode},</if>
  100. </trim>
  101. </insert>
  102. <update id="updateBdglConsumeArchives" parameterType="BdglConsumeArchives">
  103. update bdgl_consume_archives
  104. <trim prefix="SET" suffixOverrides=",">
  105. <if test="durgName != null">durg_name = #{durgName},</if>
  106. <if test="durgBrand != null">durg_brand = #{durgBrand},</if>
  107. <if test="manufacturer != null">manufacturer = #{manufacturer},</if>
  108. <if test="specifications != null">specifications = #{specifications},</if>
  109. <if test="productIntroduction != null">product_introduction = #{productIntroduction},</if>
  110. <if test="storeHouse != null">store_house = #{storeHouse},</if>
  111. <if test="unitId != null">unit_id = #{unitId},</if>
  112. <if test="amount != null">amount = #{amount},</if>
  113. <if test="putIn != null">put_in = #{putIn},</if>
  114. <if test="putOut != null">put_out = #{putOut},</if>
  115. <if test="overdue != null">overdue = #{overdue},</if>
  116. <if test="remarks != null">remarks = #{remarks},</if>
  117. <if test="adminId != null">admin_id = #{adminId},</if>
  118. <if test="createTime != null">create_time = #{createTime},</if>
  119. <if test="updateTime != null">update_time = #{updateTime},</if>
  120. <if test="unitName != null">unit_name = #{unitName},</if>
  121. <if test="userName != null">user_name = #{userName},</if>
  122. <if test="barCode != null">bar_code=#{barCode},</if>
  123. </trim>
  124. where id = #{id}
  125. </update>
  126. <delete id="deleteBdglConsumeArchivesById" parameterType="Long">
  127. delete from bdgl_consume_archives where id = #{id}
  128. </delete>
  129. <delete id="deleteBdglConsumeArchivesByIds" parameterType="String">
  130. delete from bdgl_consume_archives where id in
  131. <foreach item="id" collection="array" open="(" separator="," close=")">
  132. #{id}
  133. </foreach>
  134. </delete>
  135. </mapper>