KwsEntCertificateDao.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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.sckw.system.dao.KwsEntCertificateDao">
  4. <resultMap id="BaseResultMap" type="com.sckw.system.model.KwsEntCertificate">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="ent_id" jdbcType="BIGINT" property="entId" />
  7. <result column="type" jdbcType="INTEGER" property="type" />
  8. <result column="code" jdbcType="VARCHAR" property="code" />
  9. <result column="certificate_main" jdbcType="VARCHAR" property="certificateMain" />
  10. <result column="certificate_revolt" jdbcType="VARCHAR" property="certificateRevolt" />
  11. <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
  12. <result column="remark" jdbcType="VARCHAR" property="remark" />
  13. <result column="status" jdbcType="INTEGER" property="status" />
  14. <result column="create_by" jdbcType="BIGINT" property="createBy" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="update_by" jdbcType="BIGINT" property="updateBy" />
  17. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  18. <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
  19. </resultMap>
  20. <sql id="Base_Column_List">
  21. id, ent_id, type, code, certificate_main, certificate_revolt, remark, status, create_by,
  22. create_time, update_by, update_time, del_flag, expire_time
  23. </sql>
  24. <select id="selectByKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  25. select
  26. <include refid="Base_Column_List" />
  27. from kws_ent_certificate
  28. where id = #{id,jdbcType=BIGINT}
  29. </select>
  30. <select id="selectByEntId" resultType="com.sckw.system.model.KwsEntCertificate">
  31. select a.* from kws_ent_certificate a where a.ent_id = #{id} and a.del_flag = 0
  32. </select>
  33. <select id="findByEntType" resultType="com.sckw.system.model.KwsEntCertificate">
  34. select a.* from kws_ent_certificate a where a.ent_id = #{entId} and a.type = #{type} and a.del_flag = 0 and a.status = 0
  35. </select>
  36. <insert id="insert" parameterType="com.sckw.system.model.KwsEntCertificate">
  37. insert into kws_ent_certificate
  38. <trim prefix="(" suffix=")" suffixOverrides=",">
  39. <if test="id != null">
  40. id,
  41. </if>
  42. <if test="entId != null">
  43. ent_id,
  44. </if>
  45. <if test="type != null">
  46. type,
  47. </if>
  48. <if test="code != null">
  49. code,
  50. </if>
  51. <if test="certificateMain != null">
  52. certificate_main,
  53. </if>
  54. <if test="certificateRevolt != null">
  55. certificate_revolt,
  56. </if>
  57. <if test="remark != null">
  58. remark,
  59. </if>
  60. <if test="status != null">
  61. status,
  62. </if>
  63. <if test="createBy != null">
  64. create_by,
  65. </if>
  66. <if test="createTime != null">
  67. create_time,
  68. </if>
  69. <if test="updateBy != null">
  70. update_by,
  71. </if>
  72. <if test="updateTime != null">
  73. update_time,
  74. </if>
  75. <if test="delFlag != null">
  76. del_flag,
  77. </if>
  78. <if test="expireTime != null">
  79. expire_time,
  80. </if>
  81. </trim>
  82. <trim prefix="values (" suffix=")" suffixOverrides=",">
  83. <if test="id != null">
  84. #{id,jdbcType=BIGINT},
  85. </if>
  86. <if test="entId != null">
  87. #{entId,jdbcType=BIGINT},
  88. </if>
  89. <if test="type != null">
  90. #{type,jdbcType=INTEGER},
  91. </if>
  92. <if test="code != null">
  93. #{code,jdbcType=VARCHAR},
  94. </if>
  95. <if test="certificateMain != null">
  96. #{certificateMain,jdbcType=VARCHAR},
  97. </if>
  98. <if test="certificateRevolt != null">
  99. #{certificateRevolt,jdbcType=VARCHAR},
  100. </if>
  101. <if test="remark != null">
  102. #{remark,jdbcType=VARCHAR},
  103. </if>
  104. <if test="status != null">
  105. #{status,jdbcType=INTEGER},
  106. </if>
  107. <if test="createBy != null">
  108. #{createBy,jdbcType=BIGINT},
  109. </if>
  110. <if test="createTime != null">
  111. #{createTime,jdbcType=TIMESTAMP},
  112. </if>
  113. <if test="updateBy != null">
  114. #{updateBy,jdbcType=BIGINT},
  115. </if>
  116. <if test="updateTime != null">
  117. #{updateTime,jdbcType=TIMESTAMP},
  118. </if>
  119. <if test="delFlag != null">
  120. #{delFlag,jdbcType=INTEGER},
  121. </if>
  122. <if test="expireTime != null">
  123. #{expireTime,jdbcType=TIMESTAMP},
  124. </if>
  125. </trim>
  126. </insert>
  127. <insert id="saveBatch">
  128. insert into kws_ent_certificate
  129. <trim prefix="(" suffix=")" suffixOverrides=",">
  130. id,
  131. ent_id,
  132. type,
  133. code,
  134. certificate_main,
  135. certificate_revolt,
  136. remark,
  137. status,
  138. create_by,
  139. create_time,
  140. update_by,
  141. update_time,
  142. del_flag,
  143. expire_time
  144. </trim>
  145. values
  146. <foreach collection="list" item="item" separator=",">
  147. <trim prefix="(" suffix=")" suffixOverrides=",">
  148. #{item.id,jdbcType=BIGINT},
  149. #{item.entId,jdbcType=BIGINT},
  150. #{item.type,jdbcType=INTEGER},
  151. #{item.code,jdbcType=VARCHAR},
  152. #{item.certificateMain,jdbcType=VARCHAR},
  153. #{item.certificateRevolt,jdbcType=VARCHAR},
  154. #{item.remark,jdbcType=VARCHAR},
  155. #{item.status,jdbcType=INTEGER},
  156. #{item.createBy,jdbcType=BIGINT},
  157. #{item.createTime,jdbcType=TIMESTAMP},
  158. #{item.updateBy,jdbcType=BIGINT},
  159. #{item.updateTime,jdbcType=TIMESTAMP},
  160. #{item.delFlag,jdbcType=INTEGER},
  161. #{item.expireTime,jdbcType=TIMESTAMP},
  162. </trim>
  163. </foreach>
  164. </insert>
  165. <update id="update" parameterType="com.sckw.system.model.KwsEntCertificate">
  166. update kws_ent_certificate
  167. <set>
  168. <if test="entId != null">
  169. ent_id = #{entId,jdbcType=BIGINT},
  170. </if>
  171. <if test="type != null">
  172. type = #{type,jdbcType=INTEGER},
  173. </if>
  174. <if test="code != null">
  175. code = #{code,jdbcType=VARCHAR},
  176. </if>
  177. <if test="certificateMain != null">
  178. certificate_main = #{certificateMain,jdbcType=VARCHAR},
  179. </if>
  180. <if test="certificateRevolt != null">
  181. certificate_revolt = #{certificateRevolt,jdbcType=VARCHAR},
  182. </if>
  183. <if test="remark != null">
  184. remark = #{remark,jdbcType=VARCHAR},
  185. </if>
  186. <if test="status != null">
  187. status = #{status,jdbcType=INTEGER},
  188. </if>
  189. <if test="createBy != null">
  190. create_by = #{createBy,jdbcType=BIGINT},
  191. </if>
  192. <if test="createTime != null">
  193. create_time = #{createTime,jdbcType=TIMESTAMP},
  194. </if>
  195. <if test="updateBy != null">
  196. update_by = #{updateBy,jdbcType=BIGINT},
  197. </if>
  198. <if test="updateTime != null">
  199. update_time = #{updateTime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="delFlag != null">
  202. del_flag = #{delFlag,jdbcType=INTEGER},
  203. </if>
  204. <if test="expireTime != null">
  205. expire_time = #{expireTime,jdbcType=TIMESTAMP},
  206. </if>
  207. </set>
  208. where id = #{id,jdbcType=BIGINT}
  209. </update>
  210. </mapper>