DepotMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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.DepotMapper">
  4. <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Depot">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="name" jdbcType="VARCHAR" property="name" />
  7. <result column="address" jdbcType="VARCHAR" property="address" />
  8. <result column="warehousing" jdbcType="DECIMAL" property="warehousing" />
  9. <result column="truckage" jdbcType="DECIMAL" property="truckage" />
  10. <result column="type" jdbcType="INTEGER" property="type" />
  11. <result column="sort" jdbcType="VARCHAR" property="sort" />
  12. <result column="remark" jdbcType="VARCHAR" property="remark" />
  13. <result column="principal" jdbcType="BIGINT" property="principal" />
  14. <result column="enabled" jdbcType="BIT" property="enabled" />
  15. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  16. <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
  17. <result column="is_default" jdbcType="BIT" property="isDefault" />
  18. </resultMap>
  19. <sql id="Example_Where_Clause">
  20. <where>
  21. <foreach collection="oredCriteria" item="criteria" separator="or">
  22. <if test="criteria.valid">
  23. <trim prefix="(" prefixOverrides="and" suffix=")">
  24. <foreach collection="criteria.criteria" item="criterion">
  25. <choose>
  26. <when test="criterion.noValue">
  27. and ${criterion.condition}
  28. </when>
  29. <when test="criterion.singleValue">
  30. and ${criterion.condition} #{criterion.value}
  31. </when>
  32. <when test="criterion.betweenValue">
  33. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  34. </when>
  35. <when test="criterion.listValue">
  36. and ${criterion.condition}
  37. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  38. #{listItem}
  39. </foreach>
  40. </when>
  41. </choose>
  42. </foreach>
  43. </trim>
  44. </if>
  45. </foreach>
  46. </where>
  47. </sql>
  48. <sql id="Update_By_Example_Where_Clause">
  49. <where>
  50. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  51. <if test="criteria.valid">
  52. <trim prefix="(" prefixOverrides="and" suffix=")">
  53. <foreach collection="criteria.criteria" item="criterion">
  54. <choose>
  55. <when test="criterion.noValue">
  56. and ${criterion.condition}
  57. </when>
  58. <when test="criterion.singleValue">
  59. and ${criterion.condition} #{criterion.value}
  60. </when>
  61. <when test="criterion.betweenValue">
  62. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  63. </when>
  64. <when test="criterion.listValue">
  65. and ${criterion.condition}
  66. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  67. #{listItem}
  68. </foreach>
  69. </when>
  70. </choose>
  71. </foreach>
  72. </trim>
  73. </if>
  74. </foreach>
  75. </where>
  76. </sql>
  77. <sql id="Base_Column_List">
  78. id, name, address, warehousing, truckage, type, sort, remark, principal, enabled,
  79. tenant_id, delete_Flag, is_default
  80. </sql>
  81. <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="BaseResultMap">
  82. select
  83. <if test="distinct">
  84. distinct
  85. </if>
  86. <include refid="Base_Column_List" />
  87. from jsh_depot
  88. <if test="_parameter != null">
  89. <include refid="Example_Where_Clause" />
  90. </if>
  91. <if test="orderByClause != null">
  92. order by ${orderByClause}
  93. </if>
  94. </select>
  95. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  96. select
  97. <include refid="Base_Column_List" />
  98. from jsh_depot
  99. where id = #{id,jdbcType=BIGINT}
  100. </select>
  101. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  102. delete from jsh_depot
  103. where id = #{id,jdbcType=BIGINT}
  104. </delete>
  105. <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample">
  106. delete from jsh_depot
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. </delete>
  111. <insert id="insert" parameterType="com.jsh.erp.datasource.entities.Depot">
  112. insert into jsh_depot (id, name, address,
  113. warehousing, truckage, type,
  114. sort, remark, principal,
  115. enabled, tenant_id, delete_Flag,
  116. is_default)
  117. values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
  118. #{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
  119. #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT},
  120. #{enabled,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR},
  121. #{isDefault,jdbcType=BIT})
  122. </insert>
  123. <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Depot">
  124. insert into jsh_depot
  125. <trim prefix="(" suffix=")" suffixOverrides=",">
  126. <if test="id != null">
  127. id,
  128. </if>
  129. <if test="name != null">
  130. name,
  131. </if>
  132. <if test="address != null">
  133. address,
  134. </if>
  135. <if test="warehousing != null">
  136. warehousing,
  137. </if>
  138. <if test="truckage != null">
  139. truckage,
  140. </if>
  141. <if test="type != null">
  142. type,
  143. </if>
  144. <if test="sort != null">
  145. sort,
  146. </if>
  147. <if test="remark != null">
  148. remark,
  149. </if>
  150. <if test="principal != null">
  151. principal,
  152. </if>
  153. <if test="enabled != null">
  154. enabled,
  155. </if>
  156. <if test="tenantId != null">
  157. tenant_id,
  158. </if>
  159. <if test="deleteFlag != null">
  160. delete_Flag,
  161. </if>
  162. <if test="isDefault != null">
  163. is_default,
  164. </if>
  165. </trim>
  166. <trim prefix="values (" suffix=")" suffixOverrides=",">
  167. <if test="id != null">
  168. #{id,jdbcType=BIGINT},
  169. </if>
  170. <if test="name != null">
  171. #{name,jdbcType=VARCHAR},
  172. </if>
  173. <if test="address != null">
  174. #{address,jdbcType=VARCHAR},
  175. </if>
  176. <if test="warehousing != null">
  177. #{warehousing,jdbcType=DECIMAL},
  178. </if>
  179. <if test="truckage != null">
  180. #{truckage,jdbcType=DECIMAL},
  181. </if>
  182. <if test="type != null">
  183. #{type,jdbcType=INTEGER},
  184. </if>
  185. <if test="sort != null">
  186. #{sort,jdbcType=VARCHAR},
  187. </if>
  188. <if test="remark != null">
  189. #{remark,jdbcType=VARCHAR},
  190. </if>
  191. <if test="principal != null">
  192. #{principal,jdbcType=BIGINT},
  193. </if>
  194. <if test="enabled != null">
  195. #{enabled,jdbcType=BIT},
  196. </if>
  197. <if test="tenantId != null">
  198. #{tenantId,jdbcType=BIGINT},
  199. </if>
  200. <if test="deleteFlag != null">
  201. #{deleteFlag,jdbcType=VARCHAR},
  202. </if>
  203. <if test="isDefault != null">
  204. #{isDefault,jdbcType=BIT},
  205. </if>
  206. </trim>
  207. </insert>
  208. <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultType="java.lang.Long">
  209. select count(*) from jsh_depot
  210. <if test="_parameter != null">
  211. <include refid="Example_Where_Clause" />
  212. </if>
  213. </select>
  214. <update id="updateByExampleSelective" parameterType="map">
  215. update jsh_depot
  216. <set>
  217. <if test="record.id != null">
  218. id = #{record.id,jdbcType=BIGINT},
  219. </if>
  220. <if test="record.name != null">
  221. name = #{record.name,jdbcType=VARCHAR},
  222. </if>
  223. <if test="record.address != null">
  224. address = #{record.address,jdbcType=VARCHAR},
  225. </if>
  226. <if test="record.warehousing != null">
  227. warehousing = #{record.warehousing,jdbcType=DECIMAL},
  228. </if>
  229. <if test="record.truckage != null">
  230. truckage = #{record.truckage,jdbcType=DECIMAL},
  231. </if>
  232. <if test="record.type != null">
  233. type = #{record.type,jdbcType=INTEGER},
  234. </if>
  235. <if test="record.sort != null">
  236. sort = #{record.sort,jdbcType=VARCHAR},
  237. </if>
  238. <if test="record.remark != null">
  239. remark = #{record.remark,jdbcType=VARCHAR},
  240. </if>
  241. <if test="record.principal != null">
  242. principal = #{record.principal,jdbcType=BIGINT},
  243. </if>
  244. <if test="record.enabled != null">
  245. enabled = #{record.enabled,jdbcType=BIT},
  246. </if>
  247. <if test="record.tenantId != null">
  248. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  249. </if>
  250. <if test="record.deleteFlag != null">
  251. delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
  252. </if>
  253. <if test="record.isDefault != null">
  254. is_default = #{record.isDefault,jdbcType=BIT},
  255. </if>
  256. </set>
  257. <if test="_parameter != null">
  258. <include refid="Update_By_Example_Where_Clause" />
  259. </if>
  260. </update>
  261. <update id="updateByExample" parameterType="map">
  262. update jsh_depot
  263. set id = #{record.id,jdbcType=BIGINT},
  264. name = #{record.name,jdbcType=VARCHAR},
  265. address = #{record.address,jdbcType=VARCHAR},
  266. warehousing = #{record.warehousing,jdbcType=DECIMAL},
  267. truckage = #{record.truckage,jdbcType=DECIMAL},
  268. type = #{record.type,jdbcType=INTEGER},
  269. sort = #{record.sort,jdbcType=VARCHAR},
  270. remark = #{record.remark,jdbcType=VARCHAR},
  271. principal = #{record.principal,jdbcType=BIGINT},
  272. enabled = #{record.enabled,jdbcType=BIT},
  273. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  274. delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
  275. is_default = #{record.isDefault,jdbcType=BIT}
  276. <if test="_parameter != null">
  277. <include refid="Update_By_Example_Where_Clause" />
  278. </if>
  279. </update>
  280. <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Depot">
  281. update jsh_depot
  282. <set>
  283. <if test="name != null">
  284. name = #{name,jdbcType=VARCHAR},
  285. </if>
  286. <if test="address != null">
  287. address = #{address,jdbcType=VARCHAR},
  288. </if>
  289. <if test="warehousing != null">
  290. warehousing = #{warehousing,jdbcType=DECIMAL},
  291. </if>
  292. <if test="truckage != null">
  293. truckage = #{truckage,jdbcType=DECIMAL},
  294. </if>
  295. <if test="type != null">
  296. type = #{type,jdbcType=INTEGER},
  297. </if>
  298. <if test="sort != null">
  299. sort = #{sort,jdbcType=VARCHAR},
  300. </if>
  301. <if test="remark != null">
  302. remark = #{remark,jdbcType=VARCHAR},
  303. </if>
  304. <if test="principal != null">
  305. principal = #{principal,jdbcType=BIGINT},
  306. </if>
  307. <if test="enabled != null">
  308. enabled = #{enabled,jdbcType=BIT},
  309. </if>
  310. <if test="tenantId != null">
  311. tenant_id = #{tenantId,jdbcType=BIGINT},
  312. </if>
  313. <if test="deleteFlag != null">
  314. delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
  315. </if>
  316. <if test="isDefault != null">
  317. is_default = #{isDefault,jdbcType=BIT},
  318. </if>
  319. </set>
  320. where id = #{id,jdbcType=BIGINT}
  321. </update>
  322. <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Depot">
  323. update jsh_depot
  324. set name = #{name,jdbcType=VARCHAR},
  325. address = #{address,jdbcType=VARCHAR},
  326. warehousing = #{warehousing,jdbcType=DECIMAL},
  327. truckage = #{truckage,jdbcType=DECIMAL},
  328. type = #{type,jdbcType=INTEGER},
  329. sort = #{sort,jdbcType=VARCHAR},
  330. remark = #{remark,jdbcType=VARCHAR},
  331. principal = #{principal,jdbcType=BIGINT},
  332. enabled = #{enabled,jdbcType=BIT},
  333. tenant_id = #{tenantId,jdbcType=BIGINT},
  334. delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
  335. is_default = #{isDefault,jdbcType=BIT}
  336. where id = #{id,jdbcType=BIGINT}
  337. </update>
  338. <select id="depotSpinnerList" resultType="com.jsh.erp.datasource.vo.SpinnerVO">
  339. SELECT
  340. id AS value,
  341. name AS label
  342. FROM
  343. jsh_depot
  344. WHERE
  345. delete_Flag = '0'
  346. </select>
  347. </mapper>