AccountHeadMapper.xml 15 KB

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