AlarmPhoneMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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.chinaitop.depot.intelligent.basicdata.mapper.AlarmPhoneMapper">
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhone">
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="org_id" property="orgId" jdbcType="INTEGER" />
  7. <result column="alarm_man" property="alarmMan" jdbcType="VARCHAR" />
  8. <result column="alarm_role" property="alarmRole" jdbcType="VARCHAR" />
  9. <result column="alarm_phone" property="alarmPhone" jdbcType="VARCHAR" />
  10. <result column="detection_type" property="detectionType" jdbcType="VARCHAR" />
  11. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  12. </resultMap>
  13. <sql id="Example_Where_Clause" >
  14. <where >
  15. <foreach collection="oredCriteria" item="criteria" separator="or" >
  16. <if test="criteria.valid" >
  17. <trim prefix="(" suffix=")" prefixOverrides="and" >
  18. <foreach collection="criteria.criteria" item="criterion" >
  19. <choose >
  20. <when test="criterion.noValue" >
  21. and ${criterion.condition}
  22. </when>
  23. <when test="criterion.singleValue" >
  24. and ${criterion.condition} #{criterion.value}
  25. </when>
  26. <when test="criterion.betweenValue" >
  27. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  28. </when>
  29. <when test="criterion.listValue" >
  30. and ${criterion.condition}
  31. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  32. #{listItem}
  33. </foreach>
  34. </when>
  35. </choose>
  36. </foreach>
  37. </trim>
  38. </if>
  39. </foreach>
  40. </where>
  41. </sql>
  42. <sql id="Update_By_Example_Where_Clause" >
  43. <where >
  44. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  45. <if test="criteria.valid" >
  46. <trim prefix="(" suffix=")" prefixOverrides="and" >
  47. <foreach collection="criteria.criteria" item="criterion" >
  48. <choose >
  49. <when test="criterion.noValue" >
  50. and ${criterion.condition}
  51. </when>
  52. <when test="criterion.singleValue" >
  53. and ${criterion.condition} #{criterion.value}
  54. </when>
  55. <when test="criterion.betweenValue" >
  56. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  57. </when>
  58. <when test="criterion.listValue" >
  59. and ${criterion.condition}
  60. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  61. #{listItem}
  62. </foreach>
  63. </when>
  64. </choose>
  65. </foreach>
  66. </trim>
  67. </if>
  68. </foreach>
  69. </where>
  70. </sql>
  71. <sql id="Base_Column_List" >
  72. id, org_id, alarm_man, alarm_role, alarm_phone, detection_type, updatetime
  73. </sql>
  74. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhoneExample" >
  75. select
  76. <if test="distinct" >
  77. distinct
  78. </if>
  79. <include refid="Base_Column_List" />
  80. from monitor_alarm_phone
  81. <if test="_parameter != null" >
  82. <include refid="Example_Where_Clause" />
  83. </if>
  84. <if test="orderByClause != null" >
  85. order by ${orderByClause}
  86. </if>
  87. </select>
  88. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  89. select
  90. <include refid="Base_Column_List" />
  91. from monitor_alarm_phone
  92. where id = #{id,jdbcType=INTEGER}
  93. </select>
  94. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  95. delete from monitor_alarm_phone
  96. where id = #{id,jdbcType=INTEGER}
  97. </delete>
  98. <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhoneExample" >
  99. delete from monitor_alarm_phone
  100. <if test="_parameter != null" >
  101. <include refid="Example_Where_Clause" />
  102. </if>
  103. </delete>
  104. <insert id="insert" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhone" >
  105. insert into monitor_alarm_phone (id, org_id, alarm_man,
  106. alarm_role, alarm_phone, detection_type,
  107. updatetime)
  108. values (#{id,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}, #{alarmMan,jdbcType=VARCHAR},
  109. #{alarmRole,jdbcType=VARCHAR}, #{alarmPhone,jdbcType=VARCHAR}, #{detectionType,jdbcType=VARCHAR},
  110. #{updatetime,jdbcType=TIMESTAMP})
  111. </insert>
  112. <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhone" >
  113. insert into monitor_alarm_phone
  114. <trim prefix="(" suffix=")" suffixOverrides="," >
  115. <if test="id != null" >
  116. id,
  117. </if>
  118. <if test="orgId != null" >
  119. org_id,
  120. </if>
  121. <if test="alarmMan != null" >
  122. alarm_man,
  123. </if>
  124. <if test="alarmRole != null" >
  125. alarm_role,
  126. </if>
  127. <if test="alarmPhone != null" >
  128. alarm_phone,
  129. </if>
  130. <if test="detectionType != null" >
  131. detection_type,
  132. </if>
  133. <if test="updatetime != null" >
  134. updatetime,
  135. </if>
  136. </trim>
  137. <trim prefix="values (" suffix=")" suffixOverrides="," >
  138. <if test="id != null" >
  139. #{id,jdbcType=INTEGER},
  140. </if>
  141. <if test="orgId != null" >
  142. #{orgId,jdbcType=INTEGER},
  143. </if>
  144. <if test="alarmMan != null" >
  145. #{alarmMan,jdbcType=VARCHAR},
  146. </if>
  147. <if test="alarmRole != null" >
  148. #{alarmRole,jdbcType=VARCHAR},
  149. </if>
  150. <if test="alarmPhone != null" >
  151. #{alarmPhone,jdbcType=VARCHAR},
  152. </if>
  153. <if test="detectionType != null" >
  154. #{detectionType,jdbcType=VARCHAR},
  155. </if>
  156. <if test="updatetime != null" >
  157. #{updatetime,jdbcType=TIMESTAMP},
  158. </if>
  159. </trim>
  160. </insert>
  161. <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhoneExample" resultType="java.lang.Integer" >
  162. select count(*) from monitor_alarm_phone
  163. <if test="_parameter != null" >
  164. <include refid="Example_Where_Clause" />
  165. </if>
  166. </select>
  167. <update id="updateByExampleSelective" parameterType="map" >
  168. update monitor_alarm_phone
  169. <set >
  170. <if test="record.id != null" >
  171. id = #{record.id,jdbcType=INTEGER},
  172. </if>
  173. <if test="record.orgId != null" >
  174. org_id = #{record.orgId,jdbcType=INTEGER},
  175. </if>
  176. <if test="record.alarmMan != null" >
  177. alarm_man = #{record.alarmMan,jdbcType=VARCHAR},
  178. </if>
  179. <if test="record.alarmRole != null" >
  180. alarm_role = #{record.alarmRole,jdbcType=VARCHAR},
  181. </if>
  182. <if test="record.alarmPhone != null" >
  183. alarm_phone = #{record.alarmPhone,jdbcType=VARCHAR},
  184. </if>
  185. <if test="record.detectionType != null" >
  186. detection_type = #{record.detectionType,jdbcType=VARCHAR},
  187. </if>
  188. <if test="record.updatetime != null" >
  189. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  190. </if>
  191. </set>
  192. <if test="_parameter != null" >
  193. <include refid="Update_By_Example_Where_Clause" />
  194. </if>
  195. </update>
  196. <update id="updateByExample" parameterType="map" >
  197. update monitor_alarm_phone
  198. set id = #{record.id,jdbcType=INTEGER},
  199. org_id = #{record.orgId,jdbcType=INTEGER},
  200. alarm_man = #{record.alarmMan,jdbcType=VARCHAR},
  201. alarm_role = #{record.alarmRole,jdbcType=VARCHAR},
  202. alarm_phone = #{record.alarmPhone,jdbcType=VARCHAR},
  203. detection_type = #{record.detectionType,jdbcType=VARCHAR},
  204. updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
  205. <if test="_parameter != null" >
  206. <include refid="Update_By_Example_Where_Clause" />
  207. </if>
  208. </update>
  209. <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhone" >
  210. update monitor_alarm_phone
  211. <set >
  212. <if test="orgId != null" >
  213. org_id = #{orgId,jdbcType=INTEGER},
  214. </if>
  215. <if test="alarmMan != null" >
  216. alarm_man = #{alarmMan,jdbcType=VARCHAR},
  217. </if>
  218. <if test="alarmRole != null" >
  219. alarm_role = #{alarmRole,jdbcType=VARCHAR},
  220. </if>
  221. <if test="alarmPhone != null" >
  222. alarm_phone = #{alarmPhone,jdbcType=VARCHAR},
  223. </if>
  224. <if test="detectionType != null" >
  225. detection_type = #{detectionType,jdbcType=VARCHAR},
  226. </if>
  227. <if test="updatetime != null" >
  228. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  229. </if>
  230. </set>
  231. where id = #{id,jdbcType=INTEGER}
  232. </update>
  233. <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.intelligent.basicdata.model.MonitorAlarmPhone" >
  234. update monitor_alarm_phone
  235. set org_id = #{orgId,jdbcType=INTEGER},
  236. alarm_man = #{alarmMan,jdbcType=VARCHAR},
  237. alarm_role = #{alarmRole,jdbcType=VARCHAR},
  238. alarm_phone = #{alarmPhone,jdbcType=VARCHAR},
  239. detection_type = #{detectionType,jdbcType=VARCHAR},
  240. updatetime = #{updatetime,jdbcType=TIMESTAMP}
  241. where id = #{id,jdbcType=INTEGER}
  242. </update>
  243. </mapper>