KwsDeviceModelMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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.KwsDeviceModelMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel">
  5. <!--@mbg.generated-->
  6. <!--@Table kws_device_model-->
  7. <id column="id" jdbcType="BIGINT" property="id"/>
  8. <result column="identify_code" jdbcType="VARCHAR" property="identifyCode"/>
  9. <result column="device_type" jdbcType="VARCHAR" property="deviceType"/>
  10. <result column="name" jdbcType="VARCHAR" property="name"/>
  11. <result column="manufacturer" jdbcType="VARCHAR" property="manufacturer"/>
  12. <result column="manufacturer_contacts" jdbcType="VARCHAR" property="manufacturerContacts"/>
  13. <result column="manufacturer_phone" jdbcType="VARCHAR" property="manufacturerPhone"/>
  14. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  15. <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
  16. <result column="status" jdbcType="TINYINT" property="status"/>
  17. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  18. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  19. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  20. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  21. <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
  22. </resultMap>
  23. <sql id="Base_Column_List">
  24. <!--@mbg.generated-->
  25. id,
  26. identify_code,
  27. device_type,
  28. `name`,
  29. manufacturer,
  30. manufacturer_contacts,
  31. manufacturer_phone,
  32. remark,
  33. `status`,
  34. create_by,
  35. create_time,
  36. update_by,
  37. update_time,
  38. del_flag,
  39. mountain_id
  40. </sql>
  41. <select id="selectListAll" resultType="com.sckw.slope.detection.model.vo.DeviceModelVo">
  42. select
  43. <include refid="Base_Column_List"/>
  44. from kws_device_model
  45. where del_flag = 0
  46. <if test="deviceModelQuery.name != null and deviceModelQuery.name != ''">
  47. and name like concat('%', #{deviceModelQuery.name}, '%')
  48. </if>
  49. <if test="deviceModelQuery.status != null and deviceModelQuery.status != ''">
  50. and status = #{deviceModelQuery.Status,jdbcType=TINYINT}
  51. </if>
  52. <if test="deviceModelQuery.mountainId != null and deviceModelQuery.mountainId != ''">
  53. and mountain_id = #{deviceModelQuery.mountainId,jdbcType=BIGINT}
  54. </if>
  55. order by create_time desc
  56. </select>
  57. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  58. <!--@mbg.generated-->
  59. select
  60. <include refid="Base_Column_List"/>
  61. from kws_device_model
  62. where id = #{id,jdbcType=BIGINT}
  63. </select>
  64. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  65. <!--@mbg.generated-->
  66. delete
  67. from kws_device_model
  68. where id = #{id,jdbcType=BIGINT}
  69. </delete>
  70. <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel">
  71. <!--@mbg.generated-->
  72. insert into kws_device_model (id, identify_code, device_type,
  73. `name`, manufacturer, manufacturer_contacts,
  74. manufacturer_phone, remark, `status`,
  75. create_by, create_time, update_by,
  76. update_time, del_flag, mountain_id)
  77. values (#{id,jdbcType=BIGINT}, #{identifyCode,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR},
  78. #{name,jdbcType=VARCHAR}, #{manufacturer,jdbcType=VARCHAR}, #{manufacturerContacts,jdbcType=VARCHAR},
  79. #{manufacturerPhone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
  80. #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
  81. #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{mountainId,jdbcType=VARCHAR})
  82. </insert>
  83. <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel">
  84. <!--@mbg.generated-->
  85. insert into kws_device_model
  86. <trim prefix="(" suffix=")" suffixOverrides=",">
  87. <if test="id != null">
  88. id,
  89. </if>
  90. <if test="identifyCode != null">
  91. identify_code,
  92. </if>
  93. <if test="deviceType != null">
  94. device_type,
  95. </if>
  96. <if test="name != null">
  97. `name`,
  98. </if>
  99. <if test="manufacturer != null">
  100. manufacturer,
  101. </if>
  102. <if test="manufacturerContacts != null">
  103. manufacturer_contacts,
  104. </if>
  105. <if test="manufacturerPhone != null">
  106. manufacturer_phone,
  107. </if>
  108. <if test="remark != null">
  109. remark,
  110. </if>
  111. <if test="status != null">
  112. `status`,
  113. </if>
  114. <if test="createBy != null">
  115. create_by,
  116. </if>
  117. <if test="createTime != null">
  118. create_time,
  119. </if>
  120. <if test="updateBy != null">
  121. update_by,
  122. </if>
  123. <if test="updateTime != null">
  124. update_time,
  125. </if>
  126. <if test="delFlag != null">
  127. del_flag,
  128. </if>
  129. </trim>
  130. <trim prefix="values (" suffix=")" suffixOverrides=",">
  131. <if test="id != null">
  132. #{id,jdbcType=BIGINT},
  133. </if>
  134. <if test="identifyCode != null">
  135. #{identifyCode,jdbcType=VARCHAR},
  136. </if>
  137. <if test="deviceType != null">
  138. #{deviceType,jdbcType=VARCHAR},
  139. </if>
  140. <if test="name != null">
  141. #{name,jdbcType=VARCHAR},
  142. </if>
  143. <if test="manufacturer != null">
  144. #{manufacturer,jdbcType=VARCHAR},
  145. </if>
  146. <if test="manufacturerContacts != null">
  147. #{manufacturerContacts,jdbcType=VARCHAR},
  148. </if>
  149. <if test="manufacturerPhone != null">
  150. #{manufacturerPhone,jdbcType=VARCHAR},
  151. </if>
  152. <if test="remark != null">
  153. #{remark,jdbcType=VARCHAR},
  154. </if>
  155. <if test="status != null">
  156. #{status,jdbcType=TINYINT},
  157. </if>
  158. <if test="createBy != null">
  159. #{createBy,jdbcType=BIGINT},
  160. </if>
  161. <if test="createTime != null">
  162. #{createTime,jdbcType=TIMESTAMP},
  163. </if>
  164. <if test="updateBy != null">
  165. #{updateBy,jdbcType=BIGINT},
  166. </if>
  167. <if test="updateTime != null">
  168. #{updateTime,jdbcType=TIMESTAMP},
  169. </if>
  170. <if test="delFlag != null">
  171. #{delFlag,jdbcType=TINYINT},
  172. </if>
  173. </trim>
  174. </insert>
  175. <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel">
  176. <!--@mbg.generated-->
  177. update kws_device_model
  178. <set>
  179. <if test="identifyCode != null">
  180. identify_code = #{identifyCode,jdbcType=VARCHAR},
  181. </if>
  182. <if test="deviceType != null">
  183. device_type = #{deviceType,jdbcType=VARCHAR},
  184. </if>
  185. <if test="name != null">
  186. `name` = #{name,jdbcType=VARCHAR},
  187. </if>
  188. <if test="manufacturer != null">
  189. manufacturer = #{manufacturer,jdbcType=VARCHAR},
  190. </if>
  191. <if test="manufacturerContacts != null">
  192. manufacturer_contacts = #{manufacturerContacts,jdbcType=VARCHAR},
  193. </if>
  194. <if test="manufacturerPhone != null">
  195. manufacturer_phone = #{manufacturerPhone,jdbcType=VARCHAR},
  196. </if>
  197. <if test="remark != null">
  198. remark = #{remark,jdbcType=VARCHAR},
  199. </if>
  200. <if test="status != null">
  201. `status` = #{status,jdbcType=TINYINT},
  202. </if>
  203. <if test="createBy != null">
  204. create_by = #{createBy,jdbcType=BIGINT},
  205. </if>
  206. <if test="createTime != null">
  207. create_time = #{createTime,jdbcType=TIMESTAMP},
  208. </if>
  209. <if test="updateBy != null">
  210. update_by = #{updateBy,jdbcType=BIGINT},
  211. </if>
  212. <if test="updateTime != null">
  213. update_time = #{updateTime,jdbcType=TIMESTAMP},
  214. </if>
  215. <if test="delFlag != null">
  216. del_flag = #{delFlag,jdbcType=TINYINT},
  217. </if>
  218. </set>
  219. where id = #{id,jdbcType=BIGINT}
  220. </update>
  221. <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel">
  222. <!--@mbg.generated-->
  223. update kws_device_model
  224. set identify_code = #{identifyCode,jdbcType=VARCHAR},
  225. device_type = #{deviceType,jdbcType=VARCHAR},
  226. `name` = #{name,jdbcType=VARCHAR},
  227. manufacturer = #{manufacturer,jdbcType=VARCHAR},
  228. manufacturer_contacts = #{manufacturerContacts,jdbcType=VARCHAR},
  229. manufacturer_phone = #{manufacturerPhone,jdbcType=VARCHAR},
  230. remark = #{remark,jdbcType=VARCHAR},
  231. `status` = #{status,jdbcType=TINYINT},
  232. create_by = #{createBy,jdbcType=BIGINT},
  233. create_time = #{createTime,jdbcType=TIMESTAMP},
  234. update_by = #{updateBy,jdbcType=BIGINT},
  235. update_time = #{updateTime,jdbcType=TIMESTAMP},
  236. del_flag = #{delFlag,jdbcType=TINYINT}
  237. where id = #{id,jdbcType=BIGINT}
  238. </update>
  239. </mapper>