MaterialExtendMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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.jsh.erp.datasource.mappers.MaterialExtendMapper">
  4. <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialExtend">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="material_id" jdbcType="BIGINT" property="materialId" />
  7. <result column="commodity_unit" jdbcType="VARCHAR" property="commodityUnit" />
  8. <result column="sku" jdbcType="VARCHAR" property="sku" />
  9. <result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
  10. <result column="commodity_decimal" jdbcType="DECIMAL" property="commodityDecimal" />
  11. <result column="wholesale_decimal" jdbcType="DECIMAL" property="wholesaleDecimal" />
  12. <result column="low_decimal" jdbcType="DECIMAL" property="lowDecimal" />
  13. <result column="default_flag" jdbcType="VARCHAR" property="defaultFlag" />
  14. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  15. <result column="create_serial" jdbcType="VARCHAR" property="createSerial" />
  16. <result column="update_serial" jdbcType="VARCHAR" property="updateSerial" />
  17. <result column="update_time" jdbcType="BIGINT" property="updateTime" />
  18. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  19. <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
  20. <result column="production_date" jdbcType="DATE" property="productionDate" />
  21. <result column="expiry_num" jdbcType="INTEGER" property="expiryNum" />
  22. <result column="supplier_id" jdbcType="BIGINT" property="supplierId" />
  23. <result column="bar_code" jdbcType="VARCHAR" property="barCode" />
  24. <result column="batch_number" jdbcType="VARCHAR" property="batchNumber" />
  25. <result column="inventory" jdbcType="BIGINT" property="inventory" />
  26. <result column="depot_id" jdbcType="BIGINT" property="depotId" />
  27. <result column="position" jdbcType="VARCHAR" property="position" />
  28. </resultMap>
  29. <sql id="Example_Where_Clause">
  30. <where>
  31. <foreach collection="oredCriteria" item="criteria" separator="or">
  32. <if test="criteria.valid">
  33. <trim prefix="(" prefixOverrides="and" suffix=")">
  34. <foreach collection="criteria.criteria" item="criterion">
  35. <choose>
  36. <when test="criterion.noValue">
  37. and ${criterion.condition}
  38. </when>
  39. <when test="criterion.singleValue">
  40. and ${criterion.condition} #{criterion.value}
  41. </when>
  42. <when test="criterion.betweenValue">
  43. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  44. </when>
  45. <when test="criterion.listValue">
  46. and ${criterion.condition}
  47. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  48. #{listItem}
  49. </foreach>
  50. </when>
  51. </choose>
  52. </foreach>
  53. </trim>
  54. </if>
  55. </foreach>
  56. </where>
  57. </sql>
  58. <sql id="Update_By_Example_Where_Clause">
  59. <where>
  60. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  61. <if test="criteria.valid">
  62. <trim prefix="(" prefixOverrides="and" suffix=")">
  63. <foreach collection="criteria.criteria" item="criterion">
  64. <choose>
  65. <when test="criterion.noValue">
  66. and ${criterion.condition}
  67. </when>
  68. <when test="criterion.singleValue">
  69. and ${criterion.condition} #{criterion.value}
  70. </when>
  71. <when test="criterion.betweenValue">
  72. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  73. </when>
  74. <when test="criterion.listValue">
  75. and ${criterion.condition}
  76. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  77. #{listItem}
  78. </foreach>
  79. </when>
  80. </choose>
  81. </foreach>
  82. </trim>
  83. </if>
  84. </foreach>
  85. </where>
  86. </sql>
  87. <sql id="Base_Column_List">
  88. id, material_id, bar_code, commodity_unit, sku, purchase_decimal, commodity_decimal,
  89. wholesale_decimal, low_decimal, default_flag, create_time, create_serial, update_serial,
  90. update_time, tenant_id, delete_Flag
  91. </sql>
  92. <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultMap="BaseResultMap">
  93. select
  94. <if test="distinct">
  95. distinct
  96. </if>
  97. <include refid="Base_Column_List" />
  98. from jsh_material_extend
  99. <if test="_parameter != null">
  100. <include refid="Example_Where_Clause" />
  101. </if>
  102. <if test="orderByClause != null">
  103. order by ${orderByClause}
  104. </if>
  105. </select>
  106. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  107. select
  108. <include refid="Base_Column_List" />
  109. from jsh_material_extend
  110. where id = #{id,jdbcType=BIGINT}
  111. </select>
  112. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  113. delete from jsh_material_extend
  114. where id = #{id,jdbcType=BIGINT}
  115. </delete>
  116. <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample">
  117. delete from jsh_material_extend
  118. <if test="_parameter != null">
  119. <include refid="Example_Where_Clause" />
  120. </if>
  121. </delete>
  122. <insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
  123. insert into jsh_material_extend (id, material_id, bar_code,
  124. commodity_unit, sku, purchase_decimal,
  125. commodity_decimal, wholesale_decimal, low_decimal,
  126. default_flag, create_time, create_serial,
  127. update_serial, update_time, tenant_id,
  128. delete_Flag)
  129. values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{barCode,jdbcType=VARCHAR},
  130. #{commodityUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, #{purchaseDecimal,jdbcType=DECIMAL},
  131. #{commodityDecimal,jdbcType=DECIMAL}, #{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL},
  132. #{defaultFlag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createSerial,jdbcType=VARCHAR},
  133. #{updateSerial,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT},
  134. #{deleteFlag,jdbcType=VARCHAR})
  135. </insert>
  136. <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
  137. insert into jsh_material_extend
  138. <trim prefix="(" suffix=")" suffixOverrides=",">
  139. <if test="id != null">
  140. id,
  141. </if>
  142. <if test="materialId != null">
  143. material_id,
  144. </if>
  145. <if test="commodityUnit != null">
  146. commodity_unit,
  147. </if>
  148. <if test="sku != null">
  149. sku,
  150. </if>
  151. <if test="purchaseDecimal != null">
  152. purchase_decimal,
  153. </if>
  154. <if test="commodityDecimal != null">
  155. commodity_decimal,
  156. </if>
  157. <if test="wholesaleDecimal != null">
  158. wholesale_decimal,
  159. </if>
  160. <if test="lowDecimal != null">
  161. low_decimal,
  162. </if>
  163. <if test="defaultFlag != null">
  164. default_flag,
  165. </if>
  166. <if test="createTime != null">
  167. create_time,
  168. </if>
  169. <if test="createSerial != null">
  170. create_serial,
  171. </if>
  172. <if test="updateSerial != null">
  173. update_serial,
  174. </if>
  175. <if test="updateTime != null">
  176. update_time,
  177. </if>
  178. <if test="tenantId != null">
  179. tenant_id,
  180. </if>
  181. <if test="deleteFlag != null">
  182. delete_Flag,
  183. </if>
  184. <if test="productionDate != null">
  185. production_date,
  186. </if>
  187. <if test="expiryNum != null">
  188. expiry_num,
  189. </if>
  190. <if test="supplierId != null">
  191. supplier_id,
  192. </if>
  193. <if test="barCode != null">
  194. bar_code,
  195. </if>
  196. <if test="batchNumber != null">
  197. batch_number,
  198. </if>
  199. <if test="inventory != null">
  200. inventory,
  201. </if>
  202. <if test="depotId != null">
  203. depot_id,
  204. </if>
  205. <if test="position != null">
  206. position,
  207. </if>
  208. </trim>
  209. <trim prefix="values (" suffix=")" suffixOverrides=",">
  210. <if test="id != null">
  211. #{id,jdbcType=BIGINT},
  212. </if>
  213. <if test="materialId != null">
  214. #{materialId,jdbcType=BIGINT},
  215. </if>
  216. <if test="commodityUnit != null">
  217. #{commodityUnit,jdbcType=VARCHAR},
  218. </if>
  219. <if test="sku != null">
  220. #{sku,jdbcType=VARCHAR},
  221. </if>
  222. <if test="purchaseDecimal != null">
  223. #{purchaseDecimal,jdbcType=DECIMAL},
  224. </if>
  225. <if test="commodityDecimal != null">
  226. #{commodityDecimal,jdbcType=DECIMAL},
  227. </if>
  228. <if test="wholesaleDecimal != null">
  229. #{wholesaleDecimal,jdbcType=DECIMAL},
  230. </if>
  231. <if test="lowDecimal != null">
  232. #{lowDecimal,jdbcType=DECIMAL},
  233. </if>
  234. <if test="defaultFlag != null">
  235. #{defaultFlag,jdbcType=VARCHAR},
  236. </if>
  237. <if test="createTime != null">
  238. #{createTime,jdbcType=TIMESTAMP},
  239. </if>
  240. <if test="createSerial != null">
  241. #{createSerial,jdbcType=VARCHAR},
  242. </if>
  243. <if test="updateSerial != null">
  244. #{updateSerial,jdbcType=VARCHAR},
  245. </if>
  246. <if test="updateTime != null">
  247. #{updateTime,jdbcType=BIGINT},
  248. </if>
  249. <if test="tenantId != null">
  250. #{tenantId,jdbcType=BIGINT},
  251. </if>
  252. <if test="deleteFlag != null">
  253. #{deleteFlag,jdbcType=VARCHAR},
  254. </if>
  255. <if test="productionDate != null">
  256. #{productionDate,jdbcType=DATE},
  257. </if>
  258. <if test="expiryNum != null">
  259. #{expiryNum,jdbcType=INTEGER},
  260. </if>
  261. <if test="supplierId != null">
  262. #{supplierId,jdbcType=BIGINT},
  263. </if>
  264. <if test="barCode != null">
  265. #{barCode,jdbcType=VARCHAR},
  266. </if>
  267. <if test="batchNumber != null">
  268. #{batchNumber,jdbcType=VARCHAR},
  269. </if>
  270. <if test="inventory != null">
  271. #{inventory,jdbcType=DECIMAL},
  272. </if>
  273. <if test="depotId != null">
  274. #{depotId,jdbcType=BIGINT},
  275. </if>
  276. <if test="position != null">
  277. #{position,jdbcType=VARCHAR},
  278. </if>
  279. </trim>
  280. </insert>
  281. <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultType="java.lang.Long">
  282. select count(*) from jsh_material_extend
  283. <if test="_parameter != null">
  284. <include refid="Example_Where_Clause" />
  285. </if>
  286. </select>
  287. <update id="updateByExampleSelective" parameterType="map">
  288. update jsh_material_extend
  289. <set>
  290. <if test="record.id != null">
  291. id = #{record.id,jdbcType=BIGINT},
  292. </if>
  293. <if test="record.materialId != null">
  294. material_id = #{record.materialId,jdbcType=BIGINT},
  295. </if>
  296. <if test="record.barCode != null">
  297. bar_code = #{record.barCode,jdbcType=VARCHAR},
  298. </if>
  299. <if test="record.commodityUnit != null">
  300. commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR},
  301. </if>
  302. <if test="record.sku != null">
  303. sku = #{record.sku,jdbcType=VARCHAR},
  304. </if>
  305. <if test="record.purchaseDecimal != null">
  306. purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL},
  307. </if>
  308. <if test="record.commodityDecimal != null">
  309. commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
  310. </if>
  311. <if test="record.wholesaleDecimal != null">
  312. wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
  313. </if>
  314. <if test="record.lowDecimal != null">
  315. low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
  316. </if>
  317. <if test="record.defaultFlag != null">
  318. default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
  319. </if>
  320. <if test="record.createTime != null">
  321. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  322. </if>
  323. <if test="record.createSerial != null">
  324. create_serial = #{record.createSerial,jdbcType=VARCHAR},
  325. </if>
  326. <if test="record.updateSerial != null">
  327. update_serial = #{record.updateSerial,jdbcType=VARCHAR},
  328. </if>
  329. <if test="record.updateTime != null">
  330. update_time = #{record.updateTime,jdbcType=BIGINT},
  331. </if>
  332. <if test="record.tenantId != null">
  333. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  334. </if>
  335. <if test="record.deleteFlag != null">
  336. delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
  337. </if>
  338. </set>
  339. <if test="_parameter != null">
  340. <include refid="Update_By_Example_Where_Clause" />
  341. </if>
  342. </update>
  343. <update id="updateByExample" parameterType="map">
  344. update jsh_material_extend
  345. set id = #{record.id,jdbcType=BIGINT},
  346. material_id = #{record.materialId,jdbcType=BIGINT},
  347. bar_code = #{record.barCode,jdbcType=VARCHAR},
  348. commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR},
  349. sku = #{record.sku,jdbcType=VARCHAR},
  350. purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL},
  351. commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
  352. wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
  353. low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
  354. default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
  355. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  356. create_serial = #{record.createSerial,jdbcType=VARCHAR},
  357. update_serial = #{record.updateSerial,jdbcType=VARCHAR},
  358. update_time = #{record.updateTime,jdbcType=BIGINT},
  359. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  360. delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
  361. <if test="_parameter != null">
  362. <include refid="Update_By_Example_Where_Clause" />
  363. </if>
  364. </update>
  365. <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
  366. update jsh_material_extend
  367. <set>
  368. <if test="materialId != null">
  369. material_id = #{materialId,jdbcType=BIGINT},
  370. </if>
  371. <if test="commodityUnit != null">
  372. commodity_unit = #{commodityUnit,jdbcType=VARCHAR},
  373. </if>
  374. <if test="sku != null">
  375. sku = #{sku,jdbcType=VARCHAR},
  376. </if>
  377. <if test="purchaseDecimal != null">
  378. purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
  379. </if>
  380. <if test="commodityDecimal != null">
  381. commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
  382. </if>
  383. <if test="wholesaleDecimal != null">
  384. wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
  385. </if>
  386. <if test="lowDecimal != null">
  387. low_decimal = #{lowDecimal,jdbcType=DECIMAL},
  388. </if>
  389. <if test="defaultFlag != null">
  390. default_flag = #{defaultFlag,jdbcType=VARCHAR},
  391. </if>
  392. <if test="createTime != null">
  393. create_time = #{createTime,jdbcType=TIMESTAMP},
  394. </if>
  395. <if test="createSerial != null">
  396. create_serial = #{createSerial,jdbcType=VARCHAR},
  397. </if>
  398. <if test="updateSerial != null">
  399. update_serial = #{updateSerial,jdbcType=VARCHAR},
  400. </if>
  401. <if test="updateTime != null">
  402. update_time = #{updateTime,jdbcType=BIGINT},
  403. </if>
  404. <if test="tenantId != null">
  405. tenant_id = #{tenantId,jdbcType=BIGINT},
  406. </if>
  407. <if test="deleteFlag != null">
  408. delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
  409. </if>
  410. <if test="productionDate != null">
  411. production_date = #{productionDate,jdbcType=DATE},
  412. </if>
  413. <if test="expiryNum != null">
  414. expiry_num = #{expiryNum,jdbcType=INTEGER},
  415. </if>
  416. <if test="supplierId != null">
  417. supplier_id = #{supplierId,jdbcType=BIGINT},
  418. </if>
  419. <if test="barCode != null">
  420. bar_code = #{barCode,jdbcType=VARCHAR},
  421. </if>
  422. <if test="inventory != null">
  423. inventory = #{inventory,jdbcType=DECIMAL},
  424. </if>
  425. <if test="depotId != null">
  426. depot_id = #{depotId,jdbcType=BIGINT},
  427. </if>
  428. <if test="position != null">
  429. position = #{position,jdbcType=VARCHAR},
  430. </if>
  431. </set>
  432. where id = #{id,jdbcType=BIGINT}
  433. </update>
  434. <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
  435. update jsh_material_extend
  436. set material_id = #{materialId,jdbcType=BIGINT},
  437. bar_code = #{barCode,jdbcType=VARCHAR},
  438. commodity_unit = #{commodityUnit,jdbcType=VARCHAR},
  439. sku = #{sku,jdbcType=VARCHAR},
  440. purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
  441. commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
  442. wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
  443. low_decimal = #{lowDecimal,jdbcType=DECIMAL},
  444. default_flag = #{defaultFlag,jdbcType=VARCHAR},
  445. create_time = #{createTime,jdbcType=TIMESTAMP},
  446. create_serial = #{createSerial,jdbcType=VARCHAR},
  447. update_serial = #{updateSerial,jdbcType=VARCHAR},
  448. update_time = #{updateTime,jdbcType=BIGINT},
  449. tenant_id = #{tenantId,jdbcType=BIGINT},
  450. delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
  451. where id = #{id,jdbcType=BIGINT}
  452. </update>
  453. </mapper>