KwsIntegrationMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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.slope.detection.dao.mysql.KwsIntegrationMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsIntegration">
  5. <!--@mbg.generated-->
  6. <!--@Table kws_integration-->
  7. <id column="id" jdbcType="BIGINT" property="id" />
  8. <result column="integration_name" jdbcType="VARCHAR" property="integrationName" />
  9. <result column="part_names" jdbcType="VARCHAR" property="partNames" />
  10. <result column="unit" jdbcType="VARCHAR" property="unit" />
  11. <result column="formula" jdbcType="VARCHAR" property="formula" />
  12. <result column="remark" jdbcType="VARCHAR" property="remark" />
  13. <result column="status" jdbcType="TINYINT" property="status" />
  14. <result column="create_by" jdbcType="BIGINT" property="createBy" />
  15. <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
  16. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  17. <result column="update_by" jdbcType="BIGINT" property="updateBy" />
  18. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  19. <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. <!--@mbg.generated-->
  23. id, integration_name, part_names, unit, formula, remark, `status`, create_by, create_time,
  24. update_by, update_time, del_flag,mountain_id
  25. </sql>
  26. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  27. <!--@mbg.generated-->
  28. select
  29. <include refid="Base_Column_List" />
  30. from kws_integration
  31. where id = #{id,jdbcType=BIGINT}
  32. </select>
  33. <select id="getDataByFindInSet" resultType="com.sckw.slope.detection.model.vo.IntegrationItemVO">
  34. <!--@mbg.generated-->
  35. select
  36. <include refid="Base_Column_List" />
  37. from kws_integration
  38. where FIND_IN_SET(#{partNames,jdbcType=VARCHAR},part_names)
  39. </select>
  40. <select id="getDataByName" resultType="com.sckw.slope.detection.model.vo.IntegrationVo">
  41. <!--@mbg.generated-->
  42. select
  43. <include refid="Base_Column_List" />
  44. from kws_integration
  45. where del_flag=0
  46. <if test="integrationQuery.integrationName != null and integrationQuery.integrationName != ''">
  47. and integration_name like concat('%', #{integrationQuery.integrationName}, '%')
  48. </if>
  49. <if test="integrationQuery.mountainId != null and integrationQuery.mountainId != ''">
  50. and mountain_id = #{integrationQuery.mountainId,jdbcType=BIGINT}
  51. </if>
  52. order by create_time desc
  53. </select>
  54. <select id="getDataByInNames" resultType="com.sckw.slope.detection.model.vo.IntegrationVo">
  55. <!--@mbg.generated-->
  56. select
  57. <include refid="Base_Column_List" />
  58. from kws_integration
  59. where del_flag=0
  60. and mountain_id = #{mountainId}
  61. <if test="integrationName != null and integrationName != ''">
  62. and integration_name in
  63. <foreach collection="integrationName" separator="," open="(" close=")" item="Name">
  64. #{Name}
  65. </foreach>
  66. </if>
  67. order by create_time desc
  68. </select>
  69. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  70. <!--@mbg.generated-->
  71. delete from kws_integration
  72. where id = #{id,jdbcType=BIGINT}
  73. </delete>
  74. <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsIntegration">
  75. <!--@mbg.generated-->
  76. insert into kws_integration (id, integration_name, part_names,
  77. unit, formula, remark,
  78. `status`, create_by, create_time,
  79. update_by, update_time, del_flag,mountain_id,ids
  80. )
  81. values (#{id,jdbcType=BIGINT}, #{integrationName,jdbcType=VARCHAR}, #{partNames,jdbcType=VARCHAR},
  82. #{unit,jdbcType=VARCHAR}, #{formula,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
  83. #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
  84. #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{mountainId,jdbcType=BIGINT}, #{ids,jdbcType=VARCHAR}
  85. )
  86. </insert>
  87. <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsIntegration">
  88. <!--@mbg.generated-->
  89. insert into kws_integration
  90. <trim prefix="(" suffix=")" suffixOverrides=",">
  91. <if test="id != null">
  92. id,
  93. </if>
  94. <if test="integrationName != null">
  95. integration_name,
  96. </if>
  97. <if test="partNames != null">
  98. part_names,
  99. </if>
  100. <if test="unit != null">
  101. unit,
  102. </if>
  103. <if test="formula != null">
  104. formula,
  105. </if>
  106. <if test="remark != null">
  107. remark,
  108. </if>
  109. <if test="status != null">
  110. `status`,
  111. </if>
  112. <if test="createBy != null">
  113. create_by,
  114. </if>
  115. <if test="createTime != null">
  116. create_time,
  117. </if>
  118. <if test="updateBy != null">
  119. update_by,
  120. </if>
  121. <if test="updateTime != null">
  122. update_time,
  123. </if>
  124. <if test="delFlag != null">
  125. del_flag,
  126. </if>
  127. </trim>
  128. <trim prefix="values (" suffix=")" suffixOverrides=",">
  129. <if test="id != null">
  130. #{id,jdbcType=BIGINT},
  131. </if>
  132. <if test="integrationName != null">
  133. #{integrationName,jdbcType=VARCHAR},
  134. </if>
  135. <if test="partNames != null">
  136. #{partNames,jdbcType=VARCHAR},
  137. </if>
  138. <if test="unit != null">
  139. #{unit,jdbcType=VARCHAR},
  140. </if>
  141. <if test="formula != null">
  142. #{formula,jdbcType=VARCHAR},
  143. </if>
  144. <if test="remark != null">
  145. #{remark,jdbcType=VARCHAR},
  146. </if>
  147. <if test="status != null">
  148. #{status,jdbcType=TINYINT},
  149. </if>
  150. <if test="createBy != null">
  151. #{createBy,jdbcType=BIGINT},
  152. </if>
  153. <if test="createTime != null">
  154. #{createTime,jdbcType=TIMESTAMP},
  155. </if>
  156. <if test="updateBy != null">
  157. #{updateBy,jdbcType=BIGINT},
  158. </if>
  159. <if test="updateTime != null">
  160. #{updateTime,jdbcType=TIMESTAMP},
  161. </if>
  162. <if test="delFlag != null">
  163. #{delFlag,jdbcType=TINYINT},
  164. </if>
  165. </trim>
  166. </insert>
  167. <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsIntegration">
  168. <!--@mbg.generated-->
  169. update kws_integration
  170. <set>
  171. <if test="integrationName != null">
  172. integration_name = #{integrationName,jdbcType=VARCHAR},
  173. </if>
  174. <if test="partNames != null">
  175. part_names = #{partNames,jdbcType=VARCHAR},
  176. </if>
  177. <if test="unit != null">
  178. unit = #{unit,jdbcType=VARCHAR},
  179. </if>
  180. <if test="formula != null">
  181. formula = #{formula,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=TINYINT},
  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=TINYINT},
  203. </if>
  204. </set>
  205. where id = #{id,jdbcType=BIGINT}
  206. </update>
  207. <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsIntegration">
  208. <!--@mbg.generated-->
  209. update kws_integration
  210. set integration_name = #{integrationName,jdbcType=VARCHAR},
  211. part_names = #{partNames,jdbcType=VARCHAR},
  212. unit = #{unit,jdbcType=VARCHAR},
  213. formula = #{formula,jdbcType=VARCHAR},
  214. remark = #{remark,jdbcType=VARCHAR},
  215. `status` = #{status,jdbcType=TINYINT},
  216. create_by = #{createBy,jdbcType=BIGINT},
  217. create_time = #{createTime,jdbcType=TIMESTAMP},
  218. update_by = #{updateBy,jdbcType=BIGINT},
  219. update_time = #{updateTime,jdbcType=TIMESTAMP},
  220. del_flag = #{delFlag,jdbcType=TINYINT}
  221. where id = #{id,jdbcType=BIGINT}
  222. </update>
  223. </mapper>