StorageFcbgzMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  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.chinaitop.depot.keeperAccount.mapper.StorageFcbgzMapper">
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="org_id" jdbcType="VARCHAR" property="orgId" />
  7. <result column="ch" jdbcType="INTEGER" property="ch" />
  8. <result column="hwh" jdbcType="INTEGER" property="hwh" />
  9. <result column="pz" jdbcType="INTEGER" property="pz" />
  10. <result column="mxpz" jdbcType="INTEGER" property="mxpz" />
  11. <result column="lyxz" jdbcType="INTEGER" property="lyxz" />
  12. <result column="zcsl" jdbcType="DECIMAL" property="zcsl" />
  13. <result column="srsl" jdbcType="DECIMAL" property="srsl" />
  14. <result column="kcsl" jdbcType="DECIMAL" property="kcsl" />
  15. <result column="shsl" jdbcType="DECIMAL" property="shsl" />
  16. <result column="yysl" jdbcType="DECIMAL" property="yysl" />
  17. <result column="jzrq" jdbcType="TIMESTAMP" property="jzrq" />
  18. <result column="last_business_date" jdbcType="TIMESTAMP" property="lastBusinessDate" />
  19. <result column="jzr" jdbcType="VARCHAR" property="jzr" />
  20. <result column="jzsj" jdbcType="TIMESTAMP" property="jzsj" />
  21. <result column="shr" jdbcType="VARCHAR" property="shr" />
  22. <result column="shsj" jdbcType="TIMESTAMP" property="shsj" />
  23. <result column="jznd" jdbcType="VARCHAR" property="jznd" />
  24. <result column="jzpz" jdbcType="VARCHAR" property="jzpz" />
  25. <result column="jzzy" jdbcType="VARCHAR" property="jzzy" />
  26. <result column="sjfm" jdbcType="VARCHAR" property="sjfm" />
  27. <result column="data_status" jdbcType="VARCHAR" property="dataStatus" />
  28. <result column="data_type" jdbcType="VARCHAR" property="dataType" />
  29. <result column="ywlx" jdbcType="VARCHAR" property="ywlx" />
  30. <result column="cjsj" jdbcType="TIMESTAMP" property="cjsj" />
  31. <result column="is_show" jdbcType="VARCHAR" property="isShow" />
  32. <result column="sfjz" property="sfjz" jdbcType="VARCHAR" />
  33. <result column="ylorcpl" property="ylorcpl" jdbcType="VARCHAR" />
  34. </resultMap>
  35. <sql id="Example_Where_Clause">
  36. <where>
  37. <foreach collection="oredCriteria" item="criteria" separator="or">
  38. <if test="criteria.valid">
  39. <trim prefix="(" prefixOverrides="and" suffix=")">
  40. <foreach collection="criteria.criteria" item="criterion">
  41. <choose>
  42. <when test="criterion.noValue">
  43. and ${criterion.condition}
  44. </when>
  45. <when test="criterion.singleValue">
  46. and ${criterion.condition} #{criterion.value}
  47. </when>
  48. <when test="criterion.betweenValue">
  49. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  50. </when>
  51. <when test="criterion.listValue">
  52. and ${criterion.condition}
  53. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  54. #{listItem}
  55. </foreach>
  56. </when>
  57. </choose>
  58. </foreach>
  59. </trim>
  60. </if>
  61. </foreach>
  62. </where>
  63. </sql>
  64. <sql id="Update_By_Example_Where_Clause">
  65. <where>
  66. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  67. <if test="criteria.valid">
  68. <trim prefix="(" prefixOverrides="and" suffix=")">
  69. <foreach collection="criteria.criteria" item="criterion">
  70. <choose>
  71. <when test="criterion.noValue">
  72. and ${criterion.condition}
  73. </when>
  74. <when test="criterion.singleValue">
  75. and ${criterion.condition} #{criterion.value}
  76. </when>
  77. <when test="criterion.betweenValue">
  78. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  79. </when>
  80. <when test="criterion.listValue">
  81. and ${criterion.condition}
  82. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  83. #{listItem}
  84. </foreach>
  85. </when>
  86. </choose>
  87. </foreach>
  88. </trim>
  89. </if>
  90. </foreach>
  91. </where>
  92. </sql>
  93. <sql id="Base_Column_List">
  94. id, org_id, ch, hwh, pz, mxpz, lyxz, zcsl, srsl, kcsl, shsl, yysl, jzrq, last_business_date,
  95. jzr, jzsj, shr, shsj, jznd, jzpz, jzzy, sjfm, data_status, data_type, ywlx, cjsj,
  96. is_show, ylorcpl
  97. </sql>
  98. <select id="selectByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultMap="BaseResultMap">
  99. select
  100. <if test="distinct">
  101. distinct
  102. </if>
  103. <include refid="Base_Column_List" />
  104. from storage_fcbgz
  105. <if test="_parameter != null">
  106. <include refid="Example_Where_Clause" />
  107. </if>
  108. <if test="orderByClause != null">
  109. order by ${orderByClause}
  110. </if>
  111. </select>
  112. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  113. select
  114. <include refid="Base_Column_List" />
  115. from storage_fcbgz
  116. where id = #{id,jdbcType=VARCHAR}
  117. </select>
  118. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  119. delete from storage_fcbgz
  120. where id = #{id,jdbcType=VARCHAR}
  121. </delete>
  122. <delete id="deleteByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample">
  123. delete from storage_fcbgz
  124. <if test="_parameter != null">
  125. <include refid="Example_Where_Clause" />
  126. </if>
  127. </delete>
  128. <insert id="insert" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
  129. insert into storage_fcbgz (id, org_id, ch,
  130. hwh, pz, mxpz, lyxz,
  131. zcsl, srsl, kcsl, shsl,
  132. yysl, jzrq, last_business_date,
  133. jzr, jzsj, shr, shsj,
  134. jznd, jzpz, jzzy, sjfm,
  135. data_status, data_type, ywlx,
  136. cjsj, is_show, ylorcpl)
  137. values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{ch,jdbcType=INTEGER},
  138. #{hwh,jdbcType=INTEGER}, #{pz,jdbcType=INTEGER}, #{mxpz,jdbcType=INTEGER}, #{lyxz,jdbcType=INTEGER},
  139. #{zcsl,jdbcType=DECIMAL}, #{srsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, #{shsl,jdbcType=DECIMAL},
  140. #{yysl,jdbcType=DECIMAL}, #{jzrq,jdbcType=TIMESTAMP}, #{lastBusinessDate,jdbcType=TIMESTAMP},
  141. #{jzr,jdbcType=VARCHAR}, #{jzsj,jdbcType=TIMESTAMP}, #{shr,jdbcType=VARCHAR}, #{shsj,jdbcType=TIMESTAMP},
  142. #{jznd,jdbcType=VARCHAR}, #{jzpz,jdbcType=VARCHAR}, #{jzzy,jdbcType=VARCHAR}, #{sjfm,jdbcType=VARCHAR},
  143. #{dataStatus,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{ywlx,jdbcType=VARCHAR},
  144. #{cjsj,jdbcType=TIMESTAMP}, #{isShow,jdbcType=VARCHAR}, #{ylorcpl,jdbcType=VARCHAR})
  145. </insert>
  146. <insert id="insertSelective" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
  147. insert into storage_fcbgz
  148. <trim prefix="(" suffix=")" suffixOverrides=",">
  149. <if test="id != null">
  150. id,
  151. </if>
  152. <if test="orgId != null">
  153. org_id,
  154. </if>
  155. <if test="ch != null">
  156. ch,
  157. </if>
  158. <if test="hwh != null">
  159. hwh,
  160. </if>
  161. <if test="pz != null">
  162. pz,
  163. </if>
  164. <if test="mxpz != null">
  165. mxpz,
  166. </if>
  167. <if test="lyxz != null">
  168. lyxz,
  169. </if>
  170. <if test="zcsl != null">
  171. zcsl,
  172. </if>
  173. <if test="srsl != null">
  174. srsl,
  175. </if>
  176. <if test="kcsl != null">
  177. kcsl,
  178. </if>
  179. <if test="shsl != null">
  180. shsl,
  181. </if>
  182. <if test="yysl != null">
  183. yysl,
  184. </if>
  185. <if test="jzrq != null">
  186. jzrq,
  187. </if>
  188. <if test="lastBusinessDate != null">
  189. last_business_date,
  190. </if>
  191. <if test="jzr != null">
  192. jzr,
  193. </if>
  194. <if test="jzsj != null">
  195. jzsj,
  196. </if>
  197. <if test="shr != null">
  198. shr,
  199. </if>
  200. <if test="shsj != null">
  201. shsj,
  202. </if>
  203. <if test="jznd != null">
  204. jznd,
  205. </if>
  206. <if test="jzpz != null">
  207. jzpz,
  208. </if>
  209. <if test="jzzy != null">
  210. jzzy,
  211. </if>
  212. <if test="sjfm != null">
  213. sjfm,
  214. </if>
  215. <if test="dataStatus != null">
  216. data_status,
  217. </if>
  218. <if test="dataType != null">
  219. data_type,
  220. </if>
  221. <if test="ywlx != null">
  222. ywlx,
  223. </if>
  224. <if test="cjsj != null">
  225. cjsj,
  226. </if>
  227. <if test="isShow != null">
  228. is_show,
  229. </if>
  230. <if test="ylorcpl != null">
  231. ylorcpl,
  232. </if>
  233. </trim>
  234. <trim prefix="values (" suffix=")" suffixOverrides=",">
  235. <if test="id != null">
  236. #{id,jdbcType=VARCHAR},
  237. </if>
  238. <if test="orgId != null">
  239. #{orgId,jdbcType=VARCHAR},
  240. </if>
  241. <if test="ch != null">
  242. #{ch,jdbcType=INTEGER},
  243. </if>
  244. <if test="hwh != null">
  245. #{hwh,jdbcType=INTEGER},
  246. </if>
  247. <if test="pz != null">
  248. #{pz,jdbcType=INTEGER},
  249. </if>
  250. <if test="mxpz != null">
  251. #{mxpz,jdbcType=INTEGER},
  252. </if>
  253. <if test="lyxz != null">
  254. #{lyxz,jdbcType=INTEGER},
  255. </if>
  256. <if test="zcsl != null">
  257. #{zcsl,jdbcType=DECIMAL},
  258. </if>
  259. <if test="srsl != null">
  260. #{srsl,jdbcType=DECIMAL},
  261. </if>
  262. <if test="kcsl != null">
  263. #{kcsl,jdbcType=DECIMAL},
  264. </if>
  265. <if test="shsl != null">
  266. #{shsl,jdbcType=DECIMAL},
  267. </if>
  268. <if test="yysl != null">
  269. #{yysl,jdbcType=DECIMAL},
  270. </if>
  271. <if test="jzrq != null">
  272. #{jzrq,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="lastBusinessDate != null">
  275. #{lastBusinessDate,jdbcType=TIMESTAMP},
  276. </if>
  277. <if test="jzr != null">
  278. #{jzr,jdbcType=VARCHAR},
  279. </if>
  280. <if test="jzsj != null">
  281. #{jzsj,jdbcType=TIMESTAMP},
  282. </if>
  283. <if test="shr != null">
  284. #{shr,jdbcType=VARCHAR},
  285. </if>
  286. <if test="shsj != null">
  287. #{shsj,jdbcType=TIMESTAMP},
  288. </if>
  289. <if test="jznd != null">
  290. #{jznd,jdbcType=VARCHAR},
  291. </if>
  292. <if test="jzpz != null">
  293. #{jzpz,jdbcType=VARCHAR},
  294. </if>
  295. <if test="jzzy != null">
  296. #{jzzy,jdbcType=VARCHAR},
  297. </if>
  298. <if test="sjfm != null">
  299. #{sjfm,jdbcType=VARCHAR},
  300. </if>
  301. <if test="dataStatus != null">
  302. #{dataStatus,jdbcType=VARCHAR},
  303. </if>
  304. <if test="dataType != null">
  305. #{dataType,jdbcType=VARCHAR},
  306. </if>
  307. <if test="ywlx != null">
  308. #{ywlx,jdbcType=VARCHAR},
  309. </if>
  310. <if test="cjsj != null">
  311. #{cjsj,jdbcType=TIMESTAMP},
  312. </if>
  313. <if test="isShow != null">
  314. #{isShow,jdbcType=VARCHAR},
  315. </if>
  316. <if test="ylorcpl != null">
  317. #{ylorcpl,jdbcType=VARCHAR},
  318. </if>
  319. </trim>
  320. </insert>
  321. <select id="countByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultType="java.lang.Integer">
  322. select count(*) from storage_fcbgz
  323. <if test="_parameter != null">
  324. <include refid="Example_Where_Clause" />
  325. </if>
  326. </select>
  327. <update id="updateByExampleSelective" parameterType="map">
  328. update storage_fcbgz
  329. <set>
  330. <if test="record.id != null">
  331. id = #{record.id,jdbcType=VARCHAR},
  332. </if>
  333. <if test="record.orgId != null">
  334. org_id = #{record.orgId,jdbcType=VARCHAR},
  335. </if>
  336. <if test="record.ch != null">
  337. ch = #{record.ch,jdbcType=INTEGER},
  338. </if>
  339. <if test="record.hwh != null">
  340. hwh = #{record.hwh,jdbcType=INTEGER},
  341. </if>
  342. <if test="record.pz != null">
  343. pz = #{record.pz,jdbcType=INTEGER},
  344. </if>
  345. <if test="record.mxpz != null">
  346. mxpz = #{record.mxpz,jdbcType=INTEGER},
  347. </if>
  348. <if test="record.lyxz != null">
  349. lyxz = #{record.lyxz,jdbcType=INTEGER},
  350. </if>
  351. <if test="record.zcsl != null">
  352. zcsl = #{record.zcsl,jdbcType=DECIMAL},
  353. </if>
  354. <if test="record.srsl != null">
  355. srsl = #{record.srsl,jdbcType=DECIMAL},
  356. </if>
  357. <if test="record.kcsl != null">
  358. kcsl = #{record.kcsl,jdbcType=DECIMAL},
  359. </if>
  360. <if test="record.shsl != null">
  361. shsl = #{record.shsl,jdbcType=DECIMAL},
  362. </if>
  363. <if test="record.yysl != null">
  364. yysl = #{record.yysl,jdbcType=DECIMAL},
  365. </if>
  366. <if test="record.jzrq != null">
  367. jzrq = #{record.jzrq,jdbcType=TIMESTAMP},
  368. </if>
  369. <if test="record.lastBusinessDate != null">
  370. last_business_date = #{record.lastBusinessDate,jdbcType=TIMESTAMP},
  371. </if>
  372. <if test="record.jzr != null">
  373. jzr = #{record.jzr,jdbcType=VARCHAR},
  374. </if>
  375. <if test="record.jzsj != null">
  376. jzsj = #{record.jzsj,jdbcType=TIMESTAMP},
  377. </if>
  378. <if test="record.shr != null">
  379. shr = #{record.shr,jdbcType=VARCHAR},
  380. </if>
  381. <if test="record.shsj != null">
  382. shsj = #{record.shsj,jdbcType=TIMESTAMP},
  383. </if>
  384. <if test="record.jznd != null">
  385. jznd = #{record.jznd,jdbcType=VARCHAR},
  386. </if>
  387. <if test="record.jzpz != null">
  388. jzpz = #{record.jzpz,jdbcType=VARCHAR},
  389. </if>
  390. <if test="record.jzzy != null">
  391. jzzy = #{record.jzzy,jdbcType=VARCHAR},
  392. </if>
  393. <if test="record.sjfm != null">
  394. sjfm = #{record.sjfm,jdbcType=VARCHAR},
  395. </if>
  396. <if test="record.dataStatus != null">
  397. data_status = #{record.dataStatus,jdbcType=VARCHAR},
  398. </if>
  399. <if test="record.dataType != null">
  400. data_type = #{record.dataType,jdbcType=VARCHAR},
  401. </if>
  402. <if test="record.ywlx != null">
  403. ywlx = #{record.ywlx,jdbcType=VARCHAR},
  404. </if>
  405. <if test="record.cjsj != null">
  406. cjsj = #{record.cjsj,jdbcType=TIMESTAMP},
  407. </if>
  408. <if test="record.isShow != null">
  409. is_show = #{record.isShow,jdbcType=VARCHAR},
  410. </if>
  411. <if test="record.ylorcpl != null">
  412. ylorcpl = #{record.ylorcpl,jdbcType=VARCHAR},
  413. </if>
  414. </set>
  415. <if test="_parameter != null">
  416. <include refid="Update_By_Example_Where_Clause" />
  417. </if>
  418. </update>
  419. <update id="updateByExample" parameterType="map">
  420. update storage_fcbgz
  421. set id = #{record.id,jdbcType=VARCHAR},
  422. org_id = #{record.orgId,jdbcType=VARCHAR},
  423. ch = #{record.ch,jdbcType=INTEGER},
  424. hwh = #{record.hwh,jdbcType=INTEGER},
  425. pz = #{record.pz,jdbcType=INTEGER},
  426. mxpz = #{record.mxpz,jdbcType=INTEGER},
  427. lyxz = #{record.lyxz,jdbcType=INTEGER},
  428. zcsl = #{record.zcsl,jdbcType=DECIMAL},
  429. srsl = #{record.srsl,jdbcType=DECIMAL},
  430. kcsl = #{record.kcsl,jdbcType=DECIMAL},
  431. shsl = #{record.shsl,jdbcType=DECIMAL},
  432. yysl = #{record.yysl,jdbcType=DECIMAL},
  433. jzrq = #{record.jzrq,jdbcType=TIMESTAMP},
  434. last_business_date = #{record.lastBusinessDate,jdbcType=TIMESTAMP},
  435. jzr = #{record.jzr,jdbcType=VARCHAR},
  436. jzsj = #{record.jzsj,jdbcType=TIMESTAMP},
  437. shr = #{record.shr,jdbcType=VARCHAR},
  438. shsj = #{record.shsj,jdbcType=TIMESTAMP},
  439. jznd = #{record.jznd,jdbcType=VARCHAR},
  440. jzpz = #{record.jzpz,jdbcType=VARCHAR},
  441. jzzy = #{record.jzzy,jdbcType=VARCHAR},
  442. sjfm = #{record.sjfm,jdbcType=VARCHAR},
  443. data_status = #{record.dataStatus,jdbcType=VARCHAR},
  444. data_type = #{record.dataType,jdbcType=VARCHAR},
  445. ywlx = #{record.ywlx,jdbcType=VARCHAR},
  446. cjsj = #{record.cjsj,jdbcType=TIMESTAMP},
  447. is_show = #{record.isShow,jdbcType=VARCHAR},
  448. ylorcpl = #{record.ylorcpl,jdbcType=VARCHAR}
  449. <if test="_parameter != null">
  450. <include refid="Update_By_Example_Where_Clause" />
  451. </if>
  452. </update>
  453. <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
  454. update storage_fcbgz
  455. <set>
  456. <if test="orgId != null">
  457. org_id = #{orgId,jdbcType=VARCHAR},
  458. </if>
  459. <if test="ch != null">
  460. ch = #{ch,jdbcType=INTEGER},
  461. </if>
  462. <if test="hwh != null">
  463. hwh = #{hwh,jdbcType=INTEGER},
  464. </if>
  465. <if test="pz != null">
  466. pz = #{pz,jdbcType=INTEGER},
  467. </if>
  468. <if test="mxpz != null">
  469. mxpz = #{mxpz,jdbcType=INTEGER},
  470. </if>
  471. <if test="lyxz != null">
  472. lyxz = #{lyxz,jdbcType=INTEGER},
  473. </if>
  474. <if test="zcsl != null">
  475. zcsl = #{zcsl,jdbcType=DECIMAL},
  476. </if>
  477. <if test="srsl != null">
  478. srsl = #{srsl,jdbcType=DECIMAL},
  479. </if>
  480. <if test="kcsl != null">
  481. kcsl = #{kcsl,jdbcType=DECIMAL},
  482. </if>
  483. <if test="shsl != null">
  484. shsl = #{shsl,jdbcType=DECIMAL},
  485. </if>
  486. <if test="yysl != null">
  487. yysl = #{yysl,jdbcType=DECIMAL},
  488. </if>
  489. <if test="jzrq != null">
  490. jzrq = #{jzrq,jdbcType=TIMESTAMP},
  491. </if>
  492. <if test="lastBusinessDate != null">
  493. last_business_date = #{lastBusinessDate,jdbcType=TIMESTAMP},
  494. </if>
  495. <if test="jzr != null">
  496. jzr = #{jzr,jdbcType=VARCHAR},
  497. </if>
  498. <if test="jzsj != null">
  499. jzsj = #{jzsj,jdbcType=TIMESTAMP},
  500. </if>
  501. <if test="shr != null">
  502. shr = #{shr,jdbcType=VARCHAR},
  503. </if>
  504. <if test="shsj != null">
  505. shsj = #{shsj,jdbcType=TIMESTAMP},
  506. </if>
  507. <if test="jznd != null">
  508. jznd = #{jznd,jdbcType=VARCHAR},
  509. </if>
  510. <if test="jzpz != null">
  511. jzpz = #{jzpz,jdbcType=VARCHAR},
  512. </if>
  513. <if test="jzzy != null">
  514. jzzy = #{jzzy,jdbcType=VARCHAR},
  515. </if>
  516. <if test="sjfm != null">
  517. sjfm = #{sjfm,jdbcType=VARCHAR},
  518. </if>
  519. <if test="dataStatus != null">
  520. data_status = #{dataStatus,jdbcType=VARCHAR},
  521. </if>
  522. <if test="dataType != null">
  523. data_type = #{dataType,jdbcType=VARCHAR},
  524. </if>
  525. <if test="ywlx != null">
  526. ywlx = #{ywlx,jdbcType=VARCHAR},
  527. </if>
  528. <if test="cjsj != null">
  529. cjsj = #{cjsj,jdbcType=TIMESTAMP},
  530. </if>
  531. <if test="isShow != null">
  532. is_show = #{isShow,jdbcType=VARCHAR},
  533. </if>
  534. <if test="ylorcpl != null">
  535. ylorcpl = #{ylorcpl,jdbcType=VARCHAR},
  536. </if>
  537. </set>
  538. where id = #{id,jdbcType=VARCHAR}
  539. </update>
  540. <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
  541. update storage_fcbgz
  542. set org_id = #{orgId,jdbcType=VARCHAR},
  543. ch = #{ch,jdbcType=INTEGER},
  544. hwh = #{hwh,jdbcType=INTEGER},
  545. pz = #{pz,jdbcType=INTEGER},
  546. mxpz = #{mxpz,jdbcType=INTEGER},
  547. lyxz = #{lyxz,jdbcType=INTEGER},
  548. zcsl = #{zcsl,jdbcType=DECIMAL},
  549. srsl = #{srsl,jdbcType=DECIMAL},
  550. kcsl = #{kcsl,jdbcType=DECIMAL},
  551. shsl = #{shsl,jdbcType=DECIMAL},
  552. yysl = #{yysl,jdbcType=DECIMAL},
  553. jzrq = #{jzrq,jdbcType=TIMESTAMP},
  554. last_business_date = #{lastBusinessDate,jdbcType=TIMESTAMP},
  555. jzr = #{jzr,jdbcType=VARCHAR},
  556. jzsj = #{jzsj,jdbcType=TIMESTAMP},
  557. shr = #{shr,jdbcType=VARCHAR},
  558. shsj = #{shsj,jdbcType=TIMESTAMP},
  559. jznd = #{jznd,jdbcType=VARCHAR},
  560. jzpz = #{jzpz,jdbcType=VARCHAR},
  561. jzzy = #{jzzy,jdbcType=VARCHAR},
  562. sjfm = #{sjfm,jdbcType=VARCHAR},
  563. data_status = #{dataStatus,jdbcType=VARCHAR},
  564. data_type = #{dataType,jdbcType=VARCHAR},
  565. ywlx = #{ywlx,jdbcType=VARCHAR},
  566. cjsj = #{cjsj,jdbcType=TIMESTAMP},
  567. is_show = #{isShow,jdbcType=VARCHAR},
  568. ylorcpl = #{ylorcpl,jdbcType=VARCHAR}
  569. where id = #{id,jdbcType=VARCHAR}
  570. </update>
  571. <!-- 根据出入库分仓保管账表数据分组统计查询省级储备粮数据 -->
  572. <select id="queryCrkFcbgzGroupBySclData" parameterType="java.util.Map" resultMap="BaseResultMap">
  573. select
  574. a.rqs jzrq,
  575. case
  576. when a.lchjbm='5' then b.tzdh
  577. when a.lchjbm='11' then b.tzdh
  578. when a.lchjbm='kcbd_yc' then b.bizno
  579. when a.lchjbm='kcbd_yc' then b.bizno
  580. when a.lchjbm='kcbd_rk' then c.bddh
  581. when a.lchjbm='kcbd_ck' then c.bddh
  582. when a.lchjbm='kcbd_sy' and a.cazylx='1' then d.bddh
  583. when a.lchjbm='kcbd_sy' and a.cazylx='3' then c.bddh
  584. when a.lchjbm='kcbd_xzbh' and a.cazylx='3' then c.bddh
  585. when a.lchjbm='kcbd_xzbh' and a.cazylx='1' then d.bddh
  586. when a.lchjbm='qc' then 'qckc'
  587. else 'null'
  588. end jzpz,
  589. case
  590. when a.lchjbm='5' then '轮换入库'
  591. when a.lchjbm='11' then '轮换出库'
  592. when a.lchjbm='kcbd_yc' and a.cazylx='1' then '倒仓转入'
  593. when a.lchjbm='kcbd_yc' and a.cazylx='3' then '倒仓转出'
  594. when a.lchjbm='kcbd_rk' then '溢余'
  595. when a.lchjbm='kcbd_ck' then '损耗'
  596. when a.lchjbm='kcbd_sy' and a.cazylx='1' then '移库转入'
  597. when a.lchjbm='kcbd_sy' and a.cazylx='3' then '移库转出'
  598. when a.lchjbm='kcbd_xzbh' and a.cazylx='1' then '商品粮转入'
  599. when a.lchjbm='kcbd_xzbh' and a.cazylx='3' then '转商品粮'
  600. when a.lchjbm='qc' then '期初库存'
  601. else 'null'
  602. end jzzy,
  603. a.hwxz lyxz,
  604. a.pz pz,
  605. a.mxpz mxpz,
  606. a.zcsl,
  607. a.srsl,
  608. case when a.lchjbm='kcbd_ck' then c.bdsl else 0 end shsl,
  609. case when a.lchjbm='kcbd_rk' then c.bdsl else 0 end yysl,
  610. b.kcsl kcsl,
  611. a.org_id, a.ch, a.hwh, substr(a.rqs, 1, 4) jznd,
  612. '0' data_type,
  613. '1' data_status,
  614. '0' ywlx,
  615. b.rq last_business_date
  616. from (
  617. select
  618. org_id, ch, hwh, pz, mxpz, hwxz, rqs, cazylx, lchjbm,
  619. sum(srsl) srsl, sum(zcsl) zcsl
  620. from depot_yw_fcbgz_view_model
  621. where 1=1
  622. <if test="orgId != null">
  623. and org_id=#{orgId, jdbcType=VARCHAR}
  624. </if>
  625. <if test="hwxz != null">
  626. and hwxz=#{hwxz, jdbcType=VARCHAR}
  627. </if>
  628. <if test="rqs != null">
  629. and rqs=#{rqs, jdbcType=VARCHAR}
  630. </if>
  631. group by org_id, ch, hwh, pz, mxpz, hwxz, rqs, cazylx, lchjbm
  632. ) a
  633. inner join (
  634. select f.* from (
  635. select
  636. id,org_id, ch, hwh, hwxz, pz, mxpz, rqs, cazylx, lchjbm, kcsl, rq, bizno, tzdh,
  637. Row_Number() OVER (partition by org_id,ch,hwh,hwxz,pz,mxpz,rqs,cazylx,lchjbm order by rq desc) rank
  638. from depot_yw_fcbgz_view_model
  639. where 1=1
  640. <if test="orgId != null">
  641. and org_id=#{orgId, jdbcType=VARCHAR}
  642. </if>
  643. <if test="hwxz != null">
  644. and hwxz=#{hwxz, jdbcType=VARCHAR}
  645. </if>
  646. <if test="rqs != null">
  647. and rqs=#{rqs, jdbcType=VARCHAR}
  648. </if>
  649. ) as f
  650. where 1=1 and f.rank=1
  651. ) b on b.hwh=a.hwh
  652. left join lsreport_ts:data_kcgl_kcbd_default c on c.dataid=b.id
  653. left join lsreport_ts:data_kcgl_kcbd_default d on d.dataid=reverse(b.id)
  654. left join basic_enum e1 on e1.enumid=a.hwxz
  655. left join basic_enum e2 on e2.enumid=a.pz
  656. left join basic_enum e3 on e3.enumid=a.mxpz
  657. where b.rqs=a.rqs and b.mxpz=a.mxpz and b.org_id=a.org_id and b.cazylx=a.cazylx and b.lchjbm=a.lchjbm
  658. order by b.rq
  659. </select>
  660. <select id="selectFcbgzList" parameterType="java.util.Map" resultMap="BaseResultMap">
  661. select
  662. a.*,
  663. case when b.jz_num>0 then '1' else '0' end data_status,
  664. case when c.data_status='1' then '1' else '0' end sfjz
  665. from (
  666. select
  667. org_id, ch, hwh, pz, mxpz, lyxz, jznd, kcsl
  668. from (
  669. select org_id, ch, hwh, pz, mxpz, lyxz, jznd, kcsl, Row_Number() OVER (partition by org_id, ch, hwh, pz, mxpz, lyxz, jznd order by last_business_date desc) rank
  670. from storage_fcbgz
  671. where 1=1
  672. and data_type='0'
  673. and is_show='0'
  674. <if test="orgId != null">
  675. and org_id=#{orgId, jdbcType=VARCHAR}
  676. </if>
  677. <if test="mxpz != null">
  678. and mxpz=#{mxpz,jdbcType=INTEGER}
  679. </if>
  680. <if test="lyxz != null">
  681. and lyxz=#{lyxz,jdbcType=INTEGER}
  682. </if>
  683. <if test="jznd != null">
  684. and jznd=#{jznd,jdbcType=VARCHAR}
  685. </if>
  686. ) datas
  687. where datas.rank=1
  688. ) a
  689. left join (
  690. select
  691. org_id, ch, hwh, pz, mxpz, lyxz, jznd, count(1) jz_num
  692. from storage_fcbgz
  693. where 1=1
  694. and data_type in ('0','1')
  695. and is_show='0'
  696. and data_status='1'
  697. <if test="orgId != null">
  698. and org_id=#{orgId, jdbcType=VARCHAR}
  699. </if>
  700. <if test="mxpz != null">
  701. and mxpz=#{mxpz,jdbcType=INTEGER}
  702. </if>
  703. <if test="lyxz != null">
  704. and lyxz=#{lyxz,jdbcType=INTEGER}
  705. </if>
  706. <if test="jznd != null">
  707. and jznd=#{jznd,jdbcType=VARCHAR}
  708. </if>
  709. group by org_id, ch, hwh, pz, mxpz, lyxz, jznd
  710. ) b on b.hwh=a.hwh and b.mxpz=a.mxpz and b.lyxz=a.lyxz and b.jznd=a.jznd
  711. left join (
  712. select
  713. hwh, lyxz, jznd, data_status
  714. from storage_fcbgz
  715. where 1=1
  716. and data_type='2'
  717. and is_show='0'
  718. <if test="orgId != null">
  719. and org_id=#{orgId, jdbcType=VARCHAR}
  720. </if>
  721. <if test="jznd != null">
  722. and jznd=#{jznd,jdbcType=VARCHAR}
  723. </if>
  724. ) c on c.hwh=a.hwh and c.jznd=a.jznd
  725. where 1=1
  726. <if test="sfjz==1">
  727. and nvl(c.data_status, '')=''
  728. </if>
  729. <if test="sfjz==0">
  730. and nvl(c.data_status, '')!=''
  731. </if>
  732. <if test="dataStatus==1">
  733. and b.jz_num > 0
  734. </if>
  735. <if test="dataStatus==0">
  736. and b.jz_num = 0
  737. </if>
  738. order by a.ch
  739. </select>
  740. <select id="selectCrkDetail" parameterType="java.util.Map" resultType="java.util.Map">
  741. select
  742. a.tzdh, a.bizno, c.bddh, d.bddh, a.cphm, to_char(b.rq, 'yyyy-MM-dd HH24:mi:ss') rq, b.srsl, b.zcsl, b.kcsl, a.dj
  743. from lsreport_ts:data_kcgl_xckc_default a
  744. left join lsreport_ts:data_kcgl_fcbgz_default b on b.dataid=a.dataid
  745. left join lsreport_ts:data_kcgl_kcbd_default c on c.dataid=a.dataid
  746. left join lsreport_ts:data_kcgl_kcbd_default d on d.dataid=reverse(b.dataid)
  747. where 1=1
  748. and a.sjhw=#{hwh,jdbcType=VARCHAR}
  749. and a.hwxz=#{lsxz,jdbcType=VARCHAR}
  750. and a.mxpz=#{mxpz,jdbcType=VARCHAR}
  751. and b.rq between #{starttime,jdbcType=VARCHAR} and #{endtime,jdbcType=VARCHAR}
  752. and ${wer}
  753. order by b.rq
  754. </select>
  755. <!-- 根据出入库分仓保管账表数据分组统计查询商品粮数据 -->
  756. <select id="queryCrkFcbgzGroupBySplData" parameterType="java.util.Map" resultMap="BaseResultMap">
  757. select
  758. a.rqs jzrq,
  759. case
  760. when a.lchjbm='kcbd_xzbh' and a.cazylx='3' then c.bddh
  761. when a.lchjbm='kcbd_xzbh' and a.cazylx='1' then d.bddh
  762. when a.lchjbm='kcbd_rk' then c.bddh
  763. when a.lchjbm='kcbd_ck' then c.bddh
  764. when a.lchjbm='5' then b.tzdh
  765. when a.lchjbm='11' then b.tzdh
  766. else 'null'
  767. end jzpz,
  768. case
  769. when a.lchjbm='kcbd_xzbh' and a.cazylx='1' then '市储转入'
  770. when a.lchjbm='kcbd_xzbh' and a.cazylx='3' then '转市储'
  771. when a.lchjbm='kcbd_rk' then '溢余'
  772. when a.lchjbm='kcbd_ck' then '损耗'
  773. when a.lchjbm='5' then '入库'
  774. when a.lchjbm='11' then '出库'
  775. else 'null'
  776. end jzzy,
  777. a.hwxz lyxz,
  778. a.pz pz,
  779. a.mxpz mxpz,
  780. a.zcsl,
  781. a.srsl,
  782. case when a.lchjbm='kcbd_ck' then c.bdsl else 0 end shsl,
  783. case when a.lchjbm='kcbd_rk' then c.bdsl else 0 end yysl,
  784. b.kcsl kcsl,
  785. a.org_id, a.ch, a.hwh, substr(a.rqs, 1, 4) jznd,
  786. '0' data_type,
  787. '1' data_status,
  788. '2' ywlx,
  789. b.rq last_business_date
  790. from (
  791. select
  792. org_id, ch, hwh, pz, mxpz, hwxz, rqs, cazylx, lchjbm,
  793. sum(srsl) srsl, sum(zcsl) zcsl
  794. from depot_yw_fcbgz_view_model
  795. where 1=1
  796. <if test="orgId != null">
  797. and org_id=#{orgId, jdbcType=VARCHAR}
  798. </if>
  799. <if test="hwxz != null">
  800. and hwxz=#{hwxz, jdbcType=VARCHAR}
  801. </if>
  802. <if test="rqs != null">
  803. and rqs=#{rqs, jdbcType=VARCHAR}
  804. </if>
  805. group by org_id, ch, hwh, pz, mxpz, hwxz, rqs, cazylx, lchjbm
  806. ) a
  807. inner join (
  808. select f.* from (
  809. select
  810. id,org_id, ch, hwh, hwxz, pz, mxpz, rqs, cazylx, lchjbm, kcsl, rq, bizno, tzdh,
  811. Row_Number() OVER (partition by org_id,ch,hwh,hwxz,pz,mxpz,rqs,cazylx,lchjbm order by rq desc) rank
  812. from depot_yw_fcbgz_view_model
  813. where 1=1
  814. <if test="orgId != null">
  815. and org_id=#{orgId, jdbcType=VARCHAR}
  816. </if>
  817. <if test="hwxz != null">
  818. and hwxz=#{hwxz, jdbcType=VARCHAR}
  819. </if>
  820. <if test="rqs != null">
  821. and rqs=#{rqs, jdbcType=VARCHAR}
  822. </if>
  823. ) as f
  824. where 1=1 and f.rank=1
  825. ) b on b.hwh=a.hwh
  826. left join lsreport_ts:data_kcgl_kcbd_default c on c.dataid=b.id
  827. left join lsreport_ts:data_kcgl_kcbd_default d on d.dataid=reverse(b.id)
  828. left join basic_enum e1 on e1.enumid=a.hwxz
  829. left join basic_enum e2 on e2.enumid=a.pz
  830. left join basic_enum e3 on e3.enumid=a.mxpz
  831. where b.rqs=a.rqs and b.mxpz=a.mxpz and b.org_id=a.org_id and b.cazylx=a.cazylx and b.lchjbm=a.lchjbm
  832. order by b.rq
  833. </select>
  834. </mapper>