WarehouseMapper.xml 20 KB

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