山东众工仓储管理系统后台程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

StoreMapper.xml 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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.th.demo.mapping.ware.StoreMapper" >
  4. <resultMap id="BaseResultMap" type="com.th.demo.model.ware.Store" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="layer" property="layer" jdbcType="INTEGER" />
  7. <result column="model" property="model" jdbcType="VARCHAR" />
  8. <result column="plate_no" property="plateNo" jdbcType="VARCHAR" />
  9. <result column="count" property="count" jdbcType="DOUBLE" />
  10. <result column="weight" property="weight" jdbcType="DOUBLE" />
  11. <result column="remark" property="remark" jdbcType="VARCHAR" />
  12. <result column="add_id" property="addId" jdbcType="VARCHAR" />
  13. <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
  14. <result column="modify_id" property="modifyId" jdbcType="VARCHAR" />
  15. <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
  16. <result column="cancel_id" property="cancelId" jdbcType="VARCHAR" />
  17. <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
  18. <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
  19. <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
  20. <result column="in_id" property="inId" jdbcType="VARCHAR" />
  21. <result column="out_id" property="outId" jdbcType="VARCHAR" />
  22. <result column="receive_address" property="receiveAddress" jdbcType="VARCHAR" />
  23. <result column="out_flag" property="outFlag" jdbcType="VARCHAR" />
  24. <result column="lock_flag" property="lockFlag" jdbcType="VARCHAR" />
  25. <result column="wgt_dcn_mtc_cd" property="wgtDcnMtcCd" jdbcType="VARCHAR" />
  26. <result column="edge_ty" property="edgeTy" jdbcType="VARCHAR" />
  27. <result column="production_place" property="productionPlace" jdbcType="VARCHAR" />
  28. <result column="ord_no" property="ordNo" jdbcType="VARCHAR" />
  29. <result column="car_no" property="carNo" jdbcType="VARCHAR" />
  30. <result column="tally_people" property="tallyPeople" jdbcType="VARCHAR" />
  31. <result column="fk_compony_id" property="fkComponyId" jdbcType="VARCHAR" />
  32. <result column="pack_no" property="packNo" jdbcType="VARCHAR" />
  33. <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
  34. <result column="attrib_01" property="attrib01" jdbcType="VARCHAR" />
  35. <result column="attrib_02" property="attrib02" jdbcType="VARCHAR" />
  36. <result column="attrib_03" property="attrib03" jdbcType="VARCHAR" />
  37. <result column="attrib_04" property="attrib04" jdbcType="VARCHAR" />
  38. <result column="attrib_05" property="attrib05" jdbcType="VARCHAR" />
  39. <result column="attrib_06" property="attrib06" jdbcType="VARCHAR" />
  40. <result column="attrib_07" property="attrib07" jdbcType="VARCHAR" />
  41. <result column="attrib_08" property="attrib08" jdbcType="VARCHAR" />
  42. <result column="attrib_09" property="attrib09" jdbcType="VARCHAR" />
  43. <result column="attrib_10" property="attrib10" jdbcType="VARCHAR" />
  44. <result column="fk_customer_name" property="fkCustomerName" jdbcType="VARCHAR" />
  45. <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
  46. <result column="keep_day" property="keepDay" jdbcType="DOUBLE" />
  47. <result column="ord_price" property="ordPrice" jdbcType="DOUBLE" />
  48. <result column="out_ord_price" property="outOrdPrice" jdbcType="DOUBLE" />
  49. <result column="inware_day" property="inwareDay" jdbcType="DOUBLE" />
  50. <result column="pay_way" property="payWay" jdbcType="VARCHAR" />
  51. <result column="change_count" property="changeCount" jdbcType="DOUBLE" />
  52. <association column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
  53. <association column="stack_id" property="stack" select="com.th.demo.mapping.maint.StackMapper.selectByPrimaryKey" />
  54. <association column="material_id" property="material" select="com.th.demo.mapping.maint.MaterialMapper.selectByPrimaryKey" />
  55. <association column="customer_id" property="customer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
  56. <association column="add_id" property="addUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
  57. </resultMap>
  58. <resultMap id="StoreOfWareStack" type="com.th.demo.model.ware.StoreOfWareStack" >
  59. <result column="ware_id" property="wareId" jdbcType="VARCHAR" />
  60. <result column="stack_id" property="stackId" jdbcType="VARCHAR" />
  61. </resultMap>
  62. <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
  63. <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
  64. <result column="total_weight" property="totalWeight" jdbcType="DOUBLE" />
  65. </resultMap>
  66. <sql id="Base_Column_List" >
  67. id, ware_id, stack_id, layer, material_id, model, plate_no, customer_id, count, weight,
  68. remark, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time, cancel_flag,
  69. belong_id, in_id, out_id, receive_address, out_flag, lock_flag,wgt_dcn_mtc_cd,edge_ty,production_place,
  70. pack_no,contract_no,attrib_01,attrib_02,attrib_03,attrib_04,attrib_05,attrib_06,attrib_07,attrib_08,attrib_09,attrib_10,
  71. keep_day,ord_price,out_ord_price,pay_way
  72. </sql>
  73. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  74. select
  75. *
  76. from t_ware_store
  77. where id = #{id,jdbcType=VARCHAR}
  78. </select>
  79. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  80. delete from t_ware_store
  81. where id = #{id,jdbcType=VARCHAR}
  82. </delete>
  83. <insert id="insert" parameterType="com.th.demo.model.ware.Store" >
  84. <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
  85. SELECT REPLACE(UUID(),'-','') as id from dual
  86. </selectKey>
  87. insert into t_ware_store (id, ware_id, stack_id,
  88. layer, material_id, model,
  89. plate_no, customer_id, count,
  90. weight, remark, add_id,
  91. add_time, modify_id, modify_time,
  92. cancel_id, cancel_time, cancel_flag,
  93. belong_id, in_id, out_id,
  94. receive_address, out_flag, lock_flag
  95. ,wgt_dcn_mtc_cd,edge_ty,production_place,ord_no
  96. ,car_no,tally_people,fk_compony_id,invoice_price,
  97. pack_no,contract_no,attrib_01,attrib_02,attrib_03,
  98. attrib_04,attrib_05,attrib_06,attrib_07,attrib_08,
  99. attrib_09,attrib_10,keep_day,ord_price,out_ord_price,pay_way
  100. )
  101. values (#{id,jdbcType=VARCHAR}, #{ware.id,jdbcType=VARCHAR}, #{stack.id,jdbcType=VARCHAR},
  102. #{layer,jdbcType=INTEGER}, #{material.id,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
  103. #{plateNo,jdbcType=VARCHAR}, #{customer.id,jdbcType=VARCHAR}, #{count,jdbcType=DOUBLE},
  104. #{weight,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{addId,jdbcType=VARCHAR},
  105. #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
  106. #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR},
  107. #{belongId,jdbcType=VARCHAR}, #{inId,jdbcType=VARCHAR}, #{outId,jdbcType=VARCHAR},
  108. #{receiveAddress,jdbcType=VARCHAR}, #{outFlag,jdbcType=VARCHAR}, #{lockFlag,jdbcType=VARCHAR}
  109. ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR}
  110. ,#{carNo,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{fkComponyId,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},
  111. #{packNo,jdbcType=VARCHAR},#{contractNo,jdbcType=VARCHAR},#{attrib01,jdbcType=VARCHAR},#{attrib02,jdbcType=VARCHAR},#{attrib03,jdbcType=VARCHAR},
  112. #{attrib04,jdbcType=VARCHAR},#{attrib05,jdbcType=VARCHAR},#{attrib06,jdbcType=VARCHAR},#{attrib07,jdbcType=VARCHAR},#{attrib08,jdbcType=VARCHAR},
  113. #{attrib09,jdbcType=VARCHAR},#{attrib10,jdbcType=VARCHAR},#{keepDay,jdbcType=DOUBLE},#{ordPrice,jdbcType=DOUBLE},#{outOrdPrice,jdbcType=DOUBLE},#{payWay,jdbcType=VARCHAR}
  114. )
  115. </insert>
  116. <insert id="insertSelective" parameterType="com.th.demo.model.ware.Store" >
  117. insert into t_ware_store
  118. <trim prefix="(" suffix=")" suffixOverrides="," >
  119. <if test="id != null" >
  120. id,
  121. </if>
  122. <if test="wareName != null" >
  123. ware_name,
  124. </if>
  125. <if test="stackName != null" >
  126. stack_name,
  127. </if>
  128. <if test="layer != null" >
  129. layer,
  130. </if>
  131. <if test="materialName != null" >
  132. material_name,
  133. </if>
  134. <if test="materialNo != null" >
  135. material_no,
  136. </if>
  137. <if test="standard != null" >
  138. standard,
  139. </if>
  140. <if test="model != null" >
  141. model,
  142. </if>
  143. <if test="customerName != null" >
  144. customer_name,
  145. </if>
  146. <if test="customerNo != null" >
  147. customer_no,
  148. </if>
  149. <if test="count != null" >
  150. count,
  151. </if>
  152. <if test="weight != null" >
  153. weight,
  154. </if>
  155. <if test="remark != null" >
  156. remark,
  157. </if>
  158. <if test="addId != null" >
  159. add_id,
  160. </if>
  161. <if test="addTime != null" >
  162. add_time,
  163. </if>
  164. <if test="modifyId != null" >
  165. modify_id,
  166. </if>
  167. <if test="modifyTime != null" >
  168. modify_time,
  169. </if>
  170. <if test="cancelId != null" >
  171. cancel_id,
  172. </if>
  173. <if test="cancelTime != null" >
  174. cancel_time,
  175. </if>
  176. <if test="cancelFlag != null" >
  177. cancel_flag,
  178. </if>
  179. <if test="belongId != null" >
  180. belong_id,
  181. </if>
  182. </trim>
  183. <trim prefix="values (" suffix=")" suffixOverrides="," >
  184. <if test="id != null" >
  185. #{id,jdbcType=VARCHAR},
  186. </if>
  187. <if test="wareName != null" >
  188. #{wareName,jdbcType=VARCHAR},
  189. </if>
  190. <if test="stackName != null" >
  191. #{stackName,jdbcType=VARCHAR},
  192. </if>
  193. <if test="layer != null" >
  194. #{layer,jdbcType=INTEGER},
  195. </if>
  196. <if test="materialName != null" >
  197. #{materialName,jdbcType=VARCHAR},
  198. </if>
  199. <if test="materialNo != null" >
  200. #{materialNo,jdbcType=VARCHAR},
  201. </if>
  202. <if test="standard != null" >
  203. #{standard,jdbcType=VARCHAR},
  204. </if>
  205. <if test="model != null" >
  206. #{model,jdbcType=VARCHAR},
  207. </if>
  208. <if test="customerName != null" >
  209. #{customerName,jdbcType=VARCHAR},
  210. </if>
  211. <if test="customerNo != null" >
  212. #{customerNo,jdbcType=VARCHAR},
  213. </if>
  214. <if test="count != null" >
  215. #{count,jdbcType=DOUBLE},
  216. </if>
  217. <if test="weight != null" >
  218. #{weight,jdbcType=DOUBLE},
  219. </if>
  220. <if test="remark != null" >
  221. #{remark,jdbcType=VARCHAR},
  222. </if>
  223. <if test="addId != null" >
  224. #{addId,jdbcType=VARCHAR},
  225. </if>
  226. <if test="addTime != null" >
  227. #{addTime,jdbcType=TIMESTAMP},
  228. </if>
  229. <if test="modifyId != null" >
  230. #{modifyId,jdbcType=VARCHAR},
  231. </if>
  232. <if test="modifyTime != null" >
  233. #{modifyTime,jdbcType=TIMESTAMP},
  234. </if>
  235. <if test="cancelId != null" >
  236. #{cancelId,jdbcType=VARCHAR},
  237. </if>
  238. <if test="cancelTime != null" >
  239. #{cancelTime,jdbcType=TIMESTAMP},
  240. </if>
  241. <if test="cancelFlag != null" >
  242. #{cancelFlag,jdbcType=VARCHAR},
  243. </if>
  244. <if test="belongId != null" >
  245. #{belongId,jdbcType=VARCHAR},
  246. </if>
  247. </trim>
  248. </insert>
  249. <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.ware.Store" >
  250. update t_ware_store
  251. <set >
  252. <if test="wareName != null" >
  253. ware_name = #{wareName,jdbcType=VARCHAR},
  254. </if>
  255. <if test="stackName != null" >
  256. stack_name = #{stackName,jdbcType=VARCHAR},
  257. </if>
  258. <if test="layer != null" >
  259. layer = #{layer,jdbcType=INTEGER},
  260. </if>
  261. <if test="materialName != null" >
  262. material_name = #{materialName,jdbcType=VARCHAR},
  263. </if>
  264. <if test="materialNo != null" >
  265. material_no = #{materialNo,jdbcType=VARCHAR},
  266. </if>
  267. <if test="standard != null" >
  268. standard = #{standard,jdbcType=VARCHAR},
  269. </if>
  270. <if test="model != null" >
  271. model = #{model,jdbcType=VARCHAR},
  272. </if>
  273. <if test="customerName != null" >
  274. customer_name = #{customerName,jdbcType=VARCHAR},
  275. </if>
  276. <if test="customerNo != null" >
  277. customer_no = #{customerNo,jdbcType=VARCHAR},
  278. </if>
  279. <if test="count != null" >
  280. count = #{count,jdbcType=DOUBLE},
  281. </if>
  282. <if test="weight != null" >
  283. weight = #{weight,jdbcType=DOUBLE},
  284. </if>
  285. <if test="remark != null" >
  286. remark = #{remark,jdbcType=VARCHAR},
  287. </if>
  288. <if test="addId != null" >
  289. add_id = #{addId,jdbcType=VARCHAR},
  290. </if>
  291. <if test="addTime != null" >
  292. add_time = #{addTime,jdbcType=TIMESTAMP},
  293. </if>
  294. <if test="modifyId != null" >
  295. modify_id = #{modifyId,jdbcType=VARCHAR},
  296. </if>
  297. <if test="modifyTime != null" >
  298. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  299. </if>
  300. <if test="cancelId != null" >
  301. cancel_id = #{cancelId,jdbcType=VARCHAR},
  302. </if>
  303. <if test="cancelTime != null" >
  304. cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
  305. </if>
  306. <if test="cancelFlag != null" >
  307. cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
  308. </if>
  309. <if test="belongId != null" >
  310. belong_id = #{belongId,jdbcType=VARCHAR},
  311. </if>
  312. </set>
  313. where id = #{id,jdbcType=VARCHAR}
  314. </update>
  315. <update id="updateByPrimaryKey" parameterType="com.th.demo.model.ware.Store" >
  316. update t_ware_store
  317. set ware_id = #{ware.id,jdbcType=VARCHAR},
  318. stack_id = #{stack.id,jdbcType=VARCHAR},
  319. layer = #{layer,jdbcType=INTEGER},
  320. material_id = #{material.id,jdbcType=VARCHAR},
  321. model = #{model,jdbcType=VARCHAR},
  322. plate_no = #{plateNo,jdbcType=VARCHAR},
  323. customer_id = #{customer.id,jdbcType=VARCHAR},
  324. count = #{count,jdbcType=DOUBLE},
  325. weight = #{weight,jdbcType=DOUBLE},
  326. remark = #{remark,jdbcType=VARCHAR},
  327. add_id = #{addId,jdbcType=VARCHAR},
  328. add_time = #{addTime,jdbcType=TIMESTAMP},
  329. modify_id = #{modifyId,jdbcType=VARCHAR},
  330. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  331. cancel_id = #{cancelId,jdbcType=VARCHAR},
  332. cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
  333. cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
  334. belong_id = #{belongId,jdbcType=VARCHAR},
  335. in_id = #{inId,jdbcType=VARCHAR},
  336. out_id = #{outId,jdbcType=VARCHAR},
  337. receive_address = #{receiveAddress,jdbcType=VARCHAR},
  338. out_flag = #{outFlag,jdbcType=VARCHAR},
  339. lock_flag = #{lockFlag,jdbcType=VARCHAR},
  340. pack_no = #{packNo,jdbcType=VARCHAR},
  341. contract_no = #{contractNo,jdbcType=VARCHAR},
  342. attrib_01 = #{attrib01,jdbcType=VARCHAR},
  343. attrib_02 = #{attrib02,jdbcType=VARCHAR},
  344. attrib_03 = #{attrib03,jdbcType=VARCHAR},
  345. attrib_04 = #{attrib04,jdbcType=VARCHAR},
  346. attrib_05 = #{attrib05,jdbcType=VARCHAR},
  347. attrib_06 = #{attrib06,jdbcType=VARCHAR},
  348. attrib_07 = #{attrib07,jdbcType=VARCHAR},
  349. attrib_08 = #{attrib08,jdbcType=VARCHAR},
  350. attrib_09 = #{attrib09,jdbcType=VARCHAR},
  351. attrib_10 = #{attrib10,jdbcType=VARCHAR},
  352. keep_day = #{keepDay,jdbcType=DOUBLE},
  353. ord_price = #{ordPrice,jdbcType=DOUBLE},
  354. out_ord_price = #{outOrdPrice,jdbcType=DOUBLE},
  355. pay_way = #{payWay,jdbcType=VARCHAR},
  356. ord_no= #{ordNo,jdbcType=VARCHAR},
  357. production_place= #{productionPlace,jdbcType=VARCHAR}
  358. where id = #{id,jdbcType=VARCHAR}
  359. </update>
  360. <update id="updateFKByPKey" parameterType="com.th.demo.model.ware.Store" >
  361. update t_ware_store
  362. set customer_id = #{customer.id,jdbcType=VARCHAR},
  363. fk_compony_id = #{fkComponyId,jdbcType=VARCHAR},
  364. receive_address = #{receiveAddress,jdbcType=VARCHAR},
  365. change_count = #{changeCount,jdbcType=DOUBLE}
  366. where id = #{id,jdbcType=VARCHAR}
  367. </update>
  368. <select id="selectLayerByStackId" resultType="java.lang.String" >
  369. SELECT ifnull(max(t.layer),0) from t_ware_store t
  370. where t.stack_id =#{param1,jdbcType=VARCHAR}
  371. and t.belong_id = #{param2,jdbcType=VARCHAR}
  372. and ifnull(t.cancel_flag,'0') = '0'
  373. and ifnull(t.out_flag,'0') = '0'
  374. </select>
  375. <select id="selectByWareIdStackId" resultMap="BaseResultMap" >
  376. SELECT b.name as fk_compony_id,t.* from t_ware_store t left join t_maint_customer b
  377. on t.fk_compony_id = b.id
  378. where t.ware_id = #{param1,jdbcType=VARCHAR}
  379. and t.stack_id = #{param2,jdbcType=VARCHAR}
  380. and t.belong_id = #{param3,jdbcType=VARCHAR}
  381. and ifnull(t.cancel_flag,'0') = '0'
  382. and ifnull(t.out_flag,'0') = '0'
  383. order by layer desc
  384. </select>
  385. <select id="select" resultMap="BaseResultMap" >
  386. select t.* from t_ware_store t where t.ware_name in (
  387. select b.name from t_maint_userware a ,t_maint_ware b where a.ware_id = b.id
  388. and user_id = #{param3,jdbcType=VARCHAR} ) and t.belong_id = #{param4,jdbcType=VARCHAR}
  389. <if test="param1 != ''" >
  390. and t.ware_name = #{param1,jdbcType=VARCHAR}
  391. </if>
  392. <if test="param2 != ''" >
  393. and t.stack_name = #{param2,jdbcType=VARCHAR}
  394. </if>
  395. and ifnull(t.cancel_flag,'0') = '0'
  396. and ifnull(t.out_flag,'0') = '0'
  397. order by t.stack_name asc , t.layer desc
  398. </select>
  399. <select id="selectForUpDown" resultMap="BaseResultMap" >
  400. select t.* from t_ware_store t
  401. where t.ware_id in (
  402. select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
  403. ) and t.belong_id = #{param4,jdbcType=VARCHAR}
  404. and t.ware_id = #{param1,jdbcType=VARCHAR}
  405. and t.stack_id = #{param2,jdbcType=VARCHAR}
  406. and t.layer &gt;= #{param5,jdbcType=INTEGER}
  407. and t.layer &lt;= #{param6,jdbcType=INTEGER}
  408. and ifnull(t.cancel_flag,'0') = '0'
  409. and ifnull(t.out_flag,'0') = '0'
  410. </select>
  411. <update id="updateForUpDownByStep" >
  412. update t_ware_store t set t.layer = t.layer + #{param7,jdbcType=INTEGER}
  413. where t.ware_id in (
  414. select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
  415. ) and t.belong_id = #{param4,jdbcType=VARCHAR}
  416. and t.ware_id = #{param1,jdbcType=VARCHAR}
  417. and t.stack_id = #{param2,jdbcType=VARCHAR}
  418. and t.layer &gt;= #{param5,jdbcType=INTEGER}
  419. and t.layer &lt;= #{param6,jdbcType=INTEGER}
  420. and ifnull(t.cancel_flag,'0') = '0'
  421. and ifnull(t.out_flag,'0') = '0'
  422. </update>
  423. <update id="updateForUpDownByLayer" >
  424. update t_ware_store t set t.layer = #{param7,jdbcType=INTEGER}
  425. where t.ware_id in (
  426. select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
  427. ) and t.belong_id = #{param4,jdbcType=VARCHAR}
  428. and t.ware_id = #{param1,jdbcType=VARCHAR}
  429. and t.stack_id = #{param2,jdbcType=VARCHAR}
  430. and t.layer &gt;= #{param5,jdbcType=INTEGER}
  431. and t.layer &lt;= #{param6,jdbcType=INTEGER}
  432. and ifnull(t.cancel_flag,'0') = '0'
  433. and ifnull(t.out_flag,'0') = '0'
  434. </update>
  435. <select id="selectByOutId" resultMap="BaseResultMap" >
  436. select t.* from t_ware_store t
  437. where t.ware_id in (
  438. select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
  439. ) and t.belong_id = #{param4,jdbcType=VARCHAR}
  440. and t.out_id = #{param1,jdbcType=VARCHAR}
  441. </select>
  442. <update id="updateByOutId" >
  443. update t_ware_store t set t.cancel_flag = '1'
  444. where t.ware_id in (
  445. select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
  446. ) and t.belong_id = #{param4,jdbcType=VARCHAR}
  447. and t.out_id = #{param1,jdbcType=VARCHAR}
  448. </update>
  449. <select id="selectStore" resultMap="BaseResultMap" >
  450. select e.name as fk_customer_name,DATEDIFF(now(), t.add_time) + IF(TIME(now()) > TIME(t.add_time), 1, 0) as inware_day,t.*
  451. from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d,t_maint_customer e
  452. where t.ware_id = a.id
  453. and t.stack_id = b.id
  454. and t.material_id = c.id
  455. and t.customer_id = d.id
  456. and t.fk_compony_id = e.id
  457. and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
  458. and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
  459. and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
  460. and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
  461. and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
  462. and d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
  463. and e.name like concat('%',#{param9,jdbcType=VARCHAR},'%')
  464. and (t.plate_no like concat('%',#{param10,jdbcType=VARCHAR},'%')
  465. <if test="param13 != null and param13.size() !=0" >
  466. or t.plate_no IN <foreach item="item" collection="param13" index="index" open="(" separator="," close=")">
  467. #{item,jdbcType=VARCHAR} </foreach>
  468. </if>
  469. )
  470. and (t.ord_no like concat('%',#{param11,jdbcType=VARCHAR},'%')
  471. <if test="param14 != null and param14.size() !=0" >
  472. OR t.ord_no IN <foreach item="item" collection="param14" index="index" open="(" separator="," close=")">
  473. #{item,jdbcType=VARCHAR} </foreach>
  474. </if>
  475. )
  476. and (t.contract_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
  477. <if test="param15 != null and param15.size() !=0" >
  478. OR t.contract_no IN <foreach item="item" collection="param15" index="index" open="(" separator="," close=")">
  479. #{item,jdbcType=VARCHAR} </foreach>
  480. </if>
  481. )
  482. and (t.pack_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
  483. <if test="param17 != null and param17.size() !=0" >
  484. OR t.pack_no IN <foreach item="item" collection="param17" index="index" open="(" separator="," close=")">
  485. #{item,jdbcType=VARCHAR} </foreach>
  486. </if>
  487. )
  488. and t.belong_id = #{param8,jdbcType=VARCHAR}
  489. and t.cancel_flag = '0'
  490. and t.out_flag = '0'
  491. and t.ware_id in (
  492. select m.ware_id from t_maint_userware m where m.user_id = #{param7,jdbcType=VARCHAR}
  493. )
  494. order by b.code,t.layer desc
  495. </select>
  496. <select id="selectWareStackByDistributionStore" resultMap="StoreOfWareStack" >
  497. select distinct t.ware_id ,t.stack_id
  498. from t_ware_store t where t.id in
  499. <foreach item="item" index="index" collection="storeId"
  500. open="(" separator="," close=")">
  501. #{item}
  502. </foreach>
  503. </select>
  504. <select id="selectByWareIdStackIdInStoreId" resultMap="BaseResultMap" >
  505. select *
  506. from t_ware_store t where t.id in
  507. <foreach item="item" index="index" collection="storeId"
  508. open="(" separator="," close=")">
  509. #{item}
  510. </foreach>
  511. and t.ware_id like concat('%',#{wareId,jdbcType=VARCHAR},'%')
  512. and t.stack_id like concat('%',#{stackId,jdbcType=VARCHAR},'%')
  513. </select>
  514. <update id="updateDistributionById" >
  515. update t_ware_store t
  516. set t.lock_flag = #{lockFlag,jdbcType=VARCHAR} where t.id in
  517. <foreach item="item" index="index" collection="storeId"
  518. open="(" separator="," close=")">
  519. #{item}
  520. </foreach>
  521. </update>
  522. <select id="selectForCustomer" resultMap="BaseResultMap" >
  523. select e.name as fk_compony_id,t.*
  524. from t_ware_store t left join t_maint_customer e
  525. on t.fk_compony_id = e.id
  526. , t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
  527. where t.ware_id = a.id
  528. and t.stack_id = b.id
  529. and t.material_id = c.id
  530. and t.customer_id = d.id
  531. and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
  532. and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
  533. and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
  534. and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
  535. and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
  536. <if test="param6 != null and param6 != ''" >
  537. and d.name = #{param6,jdbcType=VARCHAR}
  538. </if>
  539. and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
  540. and t.cancel_flag = '0'
  541. and t.out_flag = '0'
  542. and IFNULL(t.ord_no,'*') like concat('%',#{param11,jdbcType=VARCHAR},'%')
  543. and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
  544. </select>
  545. <select id="queryTotal" resultMap="TotalResultMap" >
  546. select sum(t.weight) as total_weight,
  547. sum(t.count) as total_amount
  548. from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
  549. where t.ware_id = a.id
  550. and t.stack_id = b.id
  551. and t.material_id = c.id
  552. and t.customer_id = d.id
  553. and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
  554. and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
  555. and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
  556. and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
  557. and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
  558. and d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
  559. and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
  560. and t.cancel_flag = '0'
  561. and t.out_flag = '0'
  562. and IFNULL(t.ord_no,'*') like concat('%',#{param11,jdbcType=VARCHAR},'%')
  563. and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
  564. </select>
  565. <select id="selEffStore" resultType="java.lang.Integer" parameterType="java.lang.String">
  566. select count(*)
  567. from t_ware_store t
  568. where t.cancel_flag = '0'
  569. and t.out_flag = '0'
  570. and t.plate_no = #{param1,jdbcType=VARCHAR};
  571. </select>
  572. </mapper>