StaSoftwareexpensesDao.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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.liang.dao.StaSoftwareexpensesDao">
  4. <resultMap type="com.liang.entity.StaSoftwareexpenses" id="StaSoftwareexpensesMap">
  5. <result property="id" column="ID" jdbcType="INTEGER"/>
  6. <result property="zb" column="ZB" jdbcType="INTEGER"/>
  7. <result property="xh" column="XH" jdbcType="INTEGER"/>
  8. <result property="rjmc" column="RJMC" jdbcType="VARCHAR"/>
  9. <result property="rjxh" column="RJXH" jdbcType="VARCHAR"/>
  10. <result property="dj" column="DJ" jdbcType="NUMERIC"/>
  11. <result property="sl" column="SL" jdbcType="INTEGER"/>
  12. <result property="zj" column="ZJ" jdbcType="NUMERIC"/>
  13. <result property="scgbydq" column="SCGBYDQ" jdbcType="VARCHAR"/>
  14. <result property="lsdw" column="LSDW" jdbcType="VARCHAR"/>
  15. <result property="rjzyjsxnzb" column="RJZYJSXNZB" jdbcType="VARCHAR"/>
  16. <result property="gzsj" column="GZSJ" jdbcType="TIMESTAMP"/>
  17. <result property="syfjqdj" column="SYFJQDJ" jdbcType="NUMERIC"/>
  18. </resultMap>
  19. <!--查询单个-->
  20. <select id="queryById" resultMap="StaSoftwareexpensesMap">
  21. select
  22. ID, ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ
  23. from sta_SoftwareExpenses
  24. where ID = #{id}
  25. </select>
  26. <!--查询指定行数据-->
  27. <select id="queryAllByLimit" resultMap="StaSoftwareexpensesMap">
  28. select
  29. ID, ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ
  30. from sta_SoftwareExpenses
  31. <where>
  32. <if test="id != null">
  33. and ID = #{id}
  34. </if>
  35. <if test="zb != null">
  36. and ZB = #{zb}
  37. </if>
  38. <if test="xh != null">
  39. and XH = #{xh}
  40. </if>
  41. <if test="rjmc != null and rjmc != ''">
  42. and RJMC = #{rjmc}
  43. </if>
  44. <if test="rjxh != null and rjxh != ''">
  45. and RJXH = #{rjxh}
  46. </if>
  47. <if test="dj != null">
  48. and DJ = #{dj}
  49. </if>
  50. <if test="sl != null">
  51. and SL = #{sl}
  52. </if>
  53. <if test="zj != null">
  54. and ZJ = #{zj}
  55. </if>
  56. <if test="scgbydq != null and scgbydq != ''">
  57. and SCGBYDQ = #{scgbydq}
  58. </if>
  59. <if test="lsdw != null and lsdw != ''">
  60. and LSDW = #{lsdw}
  61. </if>
  62. <if test="rjzyjsxnzb != null and rjzyjsxnzb != ''">
  63. and RJZYJSXNZB = #{rjzyjsxnzb}
  64. </if>
  65. <if test="gzsj != null">
  66. and GZSJ = #{gzsj}
  67. </if>
  68. <if test="syfjqdj != null">
  69. and SYFJQDJ = #{syfjqdj}
  70. </if>
  71. </where>
  72. limit #{pageable.offset}, #{pageable.pageSize}
  73. </select>
  74. <!--统计总行数-->
  75. <select id="count" resultType="java.lang.Long">
  76. select count(1)
  77. from sta_SoftwareExpenses
  78. <where>
  79. <if test="id != null">
  80. and ID = #{id}
  81. </if>
  82. <if test="zb != null">
  83. and ZB = #{zb}
  84. </if>
  85. <if test="xh != null">
  86. and XH = #{xh}
  87. </if>
  88. <if test="rjmc != null and rjmc != ''">
  89. and RJMC = #{rjmc}
  90. </if>
  91. <if test="rjxh != null and rjxh != ''">
  92. and RJXH = #{rjxh}
  93. </if>
  94. <if test="dj != null">
  95. and DJ = #{dj}
  96. </if>
  97. <if test="sl != null">
  98. and SL = #{sl}
  99. </if>
  100. <if test="zj != null">
  101. and ZJ = #{zj}
  102. </if>
  103. <if test="scgbydq != null and scgbydq != ''">
  104. and SCGBYDQ = #{scgbydq}
  105. </if>
  106. <if test="lsdw != null and lsdw != ''">
  107. and LSDW = #{lsdw}
  108. </if>
  109. <if test="rjzyjsxnzb != null and rjzyjsxnzb != ''">
  110. and RJZYJSXNZB = #{rjzyjsxnzb}
  111. </if>
  112. <if test="gzsj != null">
  113. and GZSJ = #{gzsj}
  114. </if>
  115. <if test="syfjqdj != null">
  116. and SYFJQDJ = #{syfjqdj}
  117. </if>
  118. </where>
  119. </select>
  120. <!--新增所有列-->
  121. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  122. insert into sta_SoftwareExpenses(ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ)
  123. values (#{zb}, #{xh}, #{rjmc}, #{rjxh}, #{dj}, #{sl}, #{zj}, #{scgbydq}, #{lsdw}, #{rjzyjsxnzb}, #{gzsj}, #{syfjqdj})
  124. </insert>
  125. <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
  126. insert into sta_SoftwareExpenses(ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ)
  127. values
  128. <foreach collection="entities" item="entity" separator=",">
  129. (#{entity.zb}, #{entity.xh}, #{entity.rjmc}, #{entity.rjxh}, #{entity.dj}, #{entity.sl}, #{entity.zj}, #{entity.scgbydq}, #{entity.lsdw}, #{entity.rjzyjsxnzb}, #{entity.gzsj}, #{entity.syfjqdj})
  130. </foreach>
  131. </insert>
  132. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  133. insert into sta_SoftwareExpenses(ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ)
  134. values
  135. <foreach collection="entities" item="entity" separator=",">
  136. (#{entity.zb}, #{entity.xh}, #{entity.rjmc}, #{entity.rjxh}, #{entity.dj}, #{entity.sl}, #{entity.zj}, #{entity.scgbydq}, #{entity.lsdw}, #{entity.rjzyjsxnzb}, #{entity.gzsj}, #{entity.syfjqdj})
  137. </foreach>
  138. on duplicate key update
  139. ZB = values(ZB),
  140. XH = values(XH),
  141. RJMC = values(RJMC),
  142. RJXH = values(RJXH),
  143. DJ = values(DJ),
  144. SL = values(SL),
  145. ZJ = values(ZJ),
  146. SCGBYDQ = values(SCGBYDQ),
  147. LSDW = values(LSDW),
  148. RJZYJSXNZB = values(RJZYJSXNZB),
  149. GZSJ = values(GZSJ),
  150. SYFJQDJ = values(SYFJQDJ)
  151. </insert>
  152. <!--通过主键修改数据-->
  153. <update id="update">
  154. update sta_SoftwareExpenses
  155. <set>
  156. <if test="zb != null">
  157. ZB = #{zb},
  158. </if>
  159. <if test="xh != null">
  160. XH = #{xh},
  161. </if>
  162. <if test="rjmc != null and rjmc != ''">
  163. RJMC = #{rjmc},
  164. </if>
  165. <if test="rjxh != null and rjxh != ''">
  166. RJXH = #{rjxh},
  167. </if>
  168. <if test="dj != null">
  169. DJ = #{dj},
  170. </if>
  171. <if test="sl != null">
  172. SL = #{sl},
  173. </if>
  174. <if test="zj != null">
  175. ZJ = #{zj},
  176. </if>
  177. <if test="scgbydq != null and scgbydq != ''">
  178. SCGBYDQ = #{scgbydq},
  179. </if>
  180. <if test="lsdw != null and lsdw != ''">
  181. LSDW = #{lsdw},
  182. </if>
  183. <if test="rjzyjsxnzb != null and rjzyjsxnzb != ''">
  184. RJZYJSXNZB = #{rjzyjsxnzb},
  185. </if>
  186. <if test="gzsj != null">
  187. GZSJ = #{gzsj},
  188. </if>
  189. <if test="syfjqdj != null">
  190. SYFJQDJ = #{syfjqdj},
  191. </if>
  192. </set>
  193. where ID = #{id}
  194. </update>
  195. <!--通过主键删除-->
  196. <delete id="deleteById">
  197. delete from sta_SoftwareExpenses where ID = #{id}
  198. </delete>
  199. <!--获取软件使用费列表-->
  200. <select id="getRjsyfList" resultMap="StaSoftwareexpensesMap">
  201. select *
  202. from sta_SoftwareExpenses
  203. where ZB = #{zb}
  204. </select>
  205. <!--通过主表删除-->
  206. <delete id="deleteByZb">
  207. delete from sta_SoftwareExpenses where ZB = #{zb}
  208. </delete>
  209. <!--批量删除-->
  210. <delete id="batchDeleteByZb" parameterType="java.util.ArrayList">
  211. delete from sta_SoftwareExpenses
  212. where ZB in
  213. <foreach item="item" index="index" collection="zbList" open = "(" separator = "," close = ")">
  214. #{item}
  215. </foreach>
  216. </delete>
  217. </mapper>