荣鑫后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
9.6 KiB

  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="com.gaotao.modules.purchaseorder.dao.PRHeaderMapper">
  4. <resultMap id="BaseResultMap" type="com.gaotao.modules.purchaseorder.entity.PRHeader">
  5. <!--@mbg.generated-->
  6. <!--@Table PRHeader-->
  7. <id column="RequisitionNo" jdbcType="VARCHAR" property="requisitionno"/>
  8. <id column="Site" jdbcType="VARCHAR" property="site"/>
  9. <result column="RequisitionDate" jdbcType="TIMESTAMP" property="requisitiondate"/>
  10. <result column="EnterDate" jdbcType="TIMESTAMP" property="enterdate"/>
  11. <result column="UserName" jdbcType="VARCHAR" property="username"/>
  12. <result column="Requisitioner" jdbcType="VARCHAR" property="requisitioner"/>
  13. <result column="Status" jdbcType="VARCHAR" property="status"/>
  14. <result column="Printed" jdbcType="CHAR" property="printed"/>
  15. <result column="OrderType" jdbcType="VARCHAR" property="ordertype"/>
  16. <result column="Remark" jdbcType="VARCHAR" property="remark"/>
  17. <result column="authorizeFlag" jdbcType="CHAR" property="authorizeFlag"/>
  18. <result column="approvedFlag" jdbcType="CHAR" property="approvedFlag"/>
  19. <result column="approveResult" jdbcType="VARCHAR" property="approveResult"/>
  20. <result column="Authorizator" jdbcType="VARCHAR" property="authorizator"/>
  21. <result column="authorizeDate" jdbcType="TIMESTAMP" property="authorizeDate"/>
  22. <result column="OrderRef1" jdbcType="VARCHAR" property="orderref1"/>
  23. <result column="AuthRuleID" jdbcType="VARCHAR" property="authruleid"/>
  24. </resultMap>
  25. <sql id="Base_Column_List">
  26. <!--@mbg.generated-->
  27. RequisitionNo, Site, RequisitionDate, EnterDate, UserName, Requisitioner, Status,
  28. Printed, OrderType, Remark, authorizeFlag, approvedFlag, approveResult, Authorizator,
  29. authorizeDate, OrderRef1, AuthRuleID
  30. </sql>
  31. <select id="getPRHeaderList" resultMap="BaseResultMap">
  32. <!--@mbg.generated-->
  33. select
  34. <include refid="Base_Column_List"/>
  35. from PRHeader
  36. <where>
  37. <if test="param2.site != null and param2.site != ''">
  38. and Site= #{param2.site,jdbcType=VARCHAR}
  39. </if>
  40. <if test="param2.requisitionno != null and param2.requisitionno != ''">
  41. and RequisitionNo= #{param2.requisitionno,jdbcType=VARCHAR}
  42. </if>
  43. </where>
  44. </select>
  45. <insert id="insertSelective">
  46. <!--@mbg.generated-->
  47. INSERT INTO PRHeader
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="requisitionno != null and requisitionno != ''">
  50. RequisitionNo,
  51. </if>
  52. <if test="site != null and site != ''">
  53. Site,
  54. </if>
  55. <if test="requisitiondate != null">
  56. RequisitionDate,
  57. </if>
  58. <if test="enterdate != null">
  59. EnterDate,
  60. </if>
  61. <if test="username != null and username != ''">
  62. UserName,
  63. </if>
  64. <if test="requisitioner != null and requisitioner != ''">
  65. Requisitioner,
  66. </if>
  67. <if test="status != null and status != ''">
  68. Status,
  69. </if>
  70. <if test="printed != null and printed != ''">
  71. Printed,
  72. </if>
  73. <if test="orderType != null and orderType != ''">
  74. OrderType,
  75. </if>
  76. <if test="remark != null and remark != ''">
  77. Remark,
  78. </if>
  79. <if test="authorizeFlag != null and authorizeFlag != ''">
  80. authorizeFlag,
  81. </if>
  82. <if test="approvedFlag != null and approvedFlag != ''">
  83. approvedFlag,
  84. </if>
  85. <if test="approveResult != null and approveResult != ''">
  86. approveResult,
  87. </if>
  88. <if test="authorizator != null and authorizator != ''">
  89. Authorizator,
  90. </if>
  91. <if test="authorizeDate != null">
  92. authorizeDate,
  93. </if>
  94. <if test="orderref1 != null and orderref1 != ''">
  95. OrderRef1,
  96. </if>
  97. <if test="authruleid != null and authruleid != ''">
  98. AuthRuleID
  99. </if>
  100. </trim>
  101. VALUES
  102. <trim prefix="(" suffix=")" suffixOverrides=",">
  103. <if test="requisitionno != null and requisitionno != ''">
  104. #{requisitionno,jdbcType=VARCHAR},
  105. </if>
  106. <if test="site != null and site != ''">
  107. #{site,jdbcType=VARCHAR},
  108. </if>
  109. <if test="requisitiondate != null">
  110. #{requisitiondate,jdbcType=TIMESTAMP},
  111. </if>
  112. <if test="enterdate != null">
  113. #{enterdate,jdbcType=TIMESTAMP},
  114. </if>
  115. <if test="username != null and username != ''">
  116. #{username,jdbcType=VARCHAR},
  117. </if>
  118. <if test="requisitioner != null and requisitioner != ''">
  119. #{requisitioner,jdbcType=VARCHAR},
  120. </if>
  121. <if test="status != null and status != ''">
  122. #{status,jdbcType=VARCHAR},
  123. </if>
  124. <if test="printed != null and printed != ''">
  125. #{printed,jdbcType=CHAR},
  126. </if>
  127. <if test="orderType != null and orderType != ''">
  128. #{orderType,jdbcType=VARCHAR},
  129. </if>
  130. <if test="remark != null and remark != ''">
  131. #{remark,jdbcType=VARCHAR},
  132. </if>
  133. <if test="authorizeFlag != null and authorizeFlag != ''">
  134. #{authorizeFlag,jdbcType=CHAR},
  135. </if>
  136. <if test="approvedFlag != null and approvedFlag != ''">
  137. #{approvedFlag,jdbcType=CHAR},
  138. </if>
  139. <if test="approveResult != null and approveResult != ''">
  140. #{approveResult,jdbcType=VARCHAR},
  141. </if>
  142. <if test="authorizator != null and authorizator != ''">
  143. #{authorizator,jdbcType=VARCHAR},
  144. </if>
  145. <if test="authorizeDate != null">
  146. #{authorizeDate,jdbcType=TIMESTAMP},
  147. </if>
  148. <if test="orderref1 != null and orderref1 != ''">
  149. #{orderref1,jdbcType=VARCHAR},
  150. </if>
  151. <if test="authruleid != null and authruleid != ''">
  152. #{authruleid,jdbcType=VARCHAR}
  153. </if>
  154. </trim>
  155. </insert>
  156. <update id="updatePRHeader">
  157. <!--@mbg.generated-->
  158. update PRHeader
  159. <set>
  160. <if test="requisitiondate != null">
  161. RequisitionDate = #{requisitiondate,jdbcType=TIMESTAMP},
  162. </if>
  163. <if test="enterdate != null">
  164. EnterDate = #{enterdate,jdbcType=TIMESTAMP},
  165. </if>
  166. <if test="username != null">
  167. UserName = #{username,jdbcType=VARCHAR},
  168. </if>
  169. <if test="requisitioner != null">
  170. Requisitioner = #{requisitioner,jdbcType=VARCHAR},
  171. </if>
  172. <if test="status != null">
  173. Status = #{status,jdbcType=VARCHAR},
  174. </if>
  175. <if test="printed != null">
  176. Printed = #{printed,jdbcType=CHAR},
  177. </if>
  178. <if test="ordertype != null">
  179. OrderType = #{ordertype,jdbcType=VARCHAR},
  180. </if>
  181. <if test="remark != null">
  182. Remark = #{remark,jdbcType=VARCHAR},
  183. </if>
  184. <if test="authorizeFlag != null">
  185. authorizeFlag = #{authorizeFlag,jdbcType=CHAR},
  186. </if>
  187. <if test="approvedFlag != null">
  188. approvedFlag = #{approvedFlag,jdbcType=CHAR},
  189. </if>
  190. <if test="approveResult != null">
  191. approveResult = #{approveResult,jdbcType=VARCHAR},
  192. </if>
  193. <if test="authorizator != null">
  194. Authorizator = #{authorizator,jdbcType=VARCHAR},
  195. </if>
  196. <if test="authorizeDate != null">
  197. authorizeDate = #{authorizeDate,jdbcType=TIMESTAMP},
  198. </if>
  199. <if test="orderref1 != null">
  200. OrderRef1 = #{orderref1,jdbcType=VARCHAR},
  201. </if>
  202. <if test="authruleid != null">
  203. AuthRuleID = #{authruleid,jdbcType=VARCHAR},
  204. </if>
  205. </set>
  206. <where>
  207. <if test="site != null">
  208. and Site=#{site,jdbcType=VARCHAR}
  209. </if>
  210. <if test="requisitionno != null">
  211. and RequisitionNo=#{requisitionno,jdbcType=VARCHAR}
  212. </if>
  213. </where>
  214. </update>
  215. <delete id="deletePRHeader">
  216. <!--@mbg.generated-->
  217. delete from PRHeader
  218. <where>
  219. <if test="site != null">
  220. and Site=#{site,jdbcType=VARCHAR}
  221. </if>
  222. <if test="requisitionno != null">
  223. and RequisitionNo=#{requisitionno,jdbcType=VARCHAR}
  224. </if>
  225. </where>
  226. </delete>
  227. <select id="getTransNo" resultType="java.lang.String">
  228. select dbo.Get_TransNo(#{site},#{dbType})
  229. </select>
  230. <update id="updateTransNo">
  231. exec dbo.UpdateTransNo #{site},#{dbType}
  232. </update>
  233. <update id="updateReceiveToolDetail">
  234. update po_receipt_detail_sub set tool_instance_id = #{newToolInstanceId}
  235. where tool_instance_id = #{toolInstanceId} and site = #{site}
  236. </update>
  237. </mapper>