BizObjMcMapper.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.jjt.biz.mapper.BizObjMcMapper">
  6. <resultMap type="BizObjMc" id="BizObjMcResult">
  7. <result property="mcId" column="MC_ID"/>
  8. <result property="objId" column="OBJ_ID"/>
  9. <result property="metricsId" column="METRICS_ID"/>
  10. <result property="metricsName" column="METRICS_NAME"/>
  11. <result property="metricsCode" column="METRICS_CODE"/>
  12. <result property="alarmLow" column="ALARM_LOW"/>
  13. <result property="alarmMid" column="ALARM_MID"/>
  14. <result property="alarmHigh" column="ALARM_HIGH"/>
  15. <result property="event" column="EVENT"/>
  16. <result property="dataExp" column="DATA_EXP"/>
  17. <result property="findKey" column="FIND_KEY"/>
  18. <result property="findRule" column="FIND_RULE"/>
  19. <result property="findFlag" column="FIND_FLAG"/>
  20. <result property="createBy" column="CREATE_BY"/>
  21. <result property="createTime" column="CREATE_TIME"/>
  22. <result property="updateBy" column="UPDATE_BY"/>
  23. <result property="updateTime" column="UPDATE_TIME"/>
  24. <result property="remark" column="REMARK"/>
  25. <association property="metricsDef" javaType="MetricsDef">
  26. <result property="metricsId" column="METRICS_ID_b"/>
  27. <result property="metricsName" column="METRICS_NAME_b"/>
  28. <result property="metricsCode" column="METRICS_CODE_b"/>
  29. <result property="metricsType" column="METRICS_TYPE"/>
  30. </association>
  31. </resultMap>
  32. <sql id="selectBizObjMcVo">
  33. select *
  34. from (select a.MC_ID,
  35. a.OBJ_ID,
  36. a.METRICS_ID,
  37. a.METRICS_NAME,
  38. a.METRICS_CODE,
  39. a.ALARM_LOW,
  40. a.ALARM_MID,
  41. a.ALARM_HIGH,
  42. a.EVENT,
  43. a.DATA_EXP,
  44. a.FIND_KEY,
  45. a.FIND_RULE,
  46. a.FIND_FLAG,
  47. a.CREATE_BY,
  48. a.CREATE_TIME,
  49. a.UPDATE_BY,
  50. a.UPDATE_TIME,
  51. a.REMARK,
  52. b.METRICS_ID as METRICS_ID_b,
  53. b.METRICS_CODE as METRICS_CODE_b,
  54. b.METRICS_NAME as METRICS_NAME_b,
  55. b.METRICS_TYPE
  56. from biz_obj_mc a,
  57. metrics_def b
  58. where a.METRICS_ID = b.METRICS_ID) t
  59. </sql>
  60. <select id="selectBizObjMcList" parameterType="BizObjMc" resultMap="BizObjMcResult">
  61. <include refid="selectBizObjMcVo"/>
  62. <where>
  63. <if test="objId != null ">
  64. and OBJ_ID = #{objId}
  65. </if>
  66. <if test="metricsId != null ">
  67. and METRICS_ID = #{metricsId}
  68. </if>
  69. <if test="metricsCode != null and metricsCode != ''">
  70. and METRICS_CODE = #{metricsCode}
  71. </if>
  72. <if test="alarmLow != null and alarmLow != ''">
  73. and ALARM_LOW = #{alarmLow}
  74. </if>
  75. <if test="alarmMid != null and alarmMid != ''">
  76. and ALARM_MID = #{alarmMid}
  77. </if>
  78. <if test="alarmHigh != null and alarmHigh != ''">
  79. and ALARM_HIGH = #{alarmHigh}
  80. </if>
  81. <if test="event != null and event != ''">
  82. and EVENT = #{event}
  83. </if>
  84. <if test="dataExp != null and dataExp != ''">
  85. and DATA_EXP = #{dataExp}
  86. </if>
  87. <if test="findKey != null and findKey != ''">
  88. and FIND_KEY = #{findKey}
  89. </if>
  90. <if test="findRule != null and findRule != ''">
  91. and FIND_RULE = #{findRule}
  92. </if>
  93. <if test="findFlag != null and findFlag != ''">
  94. and FIND_FLAG = #{findFlag}
  95. </if>
  96. <if test="createBy != null and createBy != ''">
  97. and CREATE_BY = #{createBy}
  98. </if>
  99. <if test="createTime != null ">
  100. and CREATE_TIME = #{createTime}
  101. </if>
  102. <if test="updateBy != null and updateBy != ''">
  103. and UPDATE_BY = #{updateBy}
  104. </if>
  105. <if test="updateTime != null ">
  106. and UPDATE_TIME = #{updateTime}
  107. </if>
  108. <if test="remark != null and remark != ''">
  109. and REMARK = #{remark}
  110. </if>
  111. </where>
  112. </select>
  113. <select id="selectBizObjMcByMcId" parameterType="Long"
  114. resultMap="BizObjMcResult">
  115. <include refid="selectBizObjMcVo"/>
  116. where MC_ID = #{mcId}
  117. </select>
  118. <insert id="insertBizObjMc" parameterType="BizObjMc" useGeneratedKeys="true"
  119. keyProperty="mcId">
  120. insert into biz_obj_mc
  121. <trim prefix="(" suffix=")" suffixOverrides=",">
  122. <if test="objId != null">OBJ_ID,
  123. </if>
  124. <if test="metricsId != null">METRICS_ID,
  125. </if>
  126. <if test="metricsCode != null">METRICS_CODE,
  127. </if>
  128. <if test="alarmLow != null">ALARM_LOW,
  129. </if>
  130. <if test="alarmMid != null">ALARM_MID,
  131. </if>
  132. <if test="alarmHigh != null">ALARM_HIGH,
  133. </if>
  134. <if test="event != null">EVENT,
  135. </if>
  136. <if test="dataExp != null">DATA_EXP,
  137. </if>
  138. <if test="findKey != null">FIND_KEY,
  139. </if>
  140. <if test="findRule != null">FIND_RULE,
  141. </if>
  142. <if test="findFlag != null">FIND_FLAG,
  143. </if>
  144. <if test="createBy != null">CREATE_BY,
  145. </if>
  146. <if test="createTime != null">CREATE_TIME,
  147. </if>
  148. <if test="updateBy != null">UPDATE_BY,
  149. </if>
  150. <if test="updateTime != null">UPDATE_TIME,
  151. </if>
  152. <if test="remark != null">REMARK,
  153. </if>
  154. </trim>
  155. <trim prefix="values (" suffix=")" suffixOverrides=",">
  156. <if test="objId != null">#{objId},
  157. </if>
  158. <if test="metricsId != null">#{metricsId},
  159. </if>
  160. <if test="metricsCode != null">#{metricsCode},
  161. </if>
  162. <if test="alarmLow != null">#{alarmLow},
  163. </if>
  164. <if test="alarmMid != null">#{alarmMid},
  165. </if>
  166. <if test="alarmHigh != null">#{alarmHigh},
  167. </if>
  168. <if test="event != null">#{event},
  169. </if>
  170. <if test="dataExp != null">#{dataExp},
  171. </if>
  172. <if test="findKey != null">#{findKey},
  173. </if>
  174. <if test="findRule != null">#{findRule},
  175. </if>
  176. <if test="findFlag != null">#{findFlag},
  177. </if>
  178. <if test="createBy != null">#{createBy},
  179. </if>
  180. <if test="createTime != null">#{createTime},
  181. </if>
  182. <if test="updateBy != null">#{updateBy},
  183. </if>
  184. <if test="updateTime != null">#{updateTime},
  185. </if>
  186. <if test="remark != null">#{remark},
  187. </if>
  188. </trim>
  189. </insert>
  190. <update id="updateBizObjMc" parameterType="BizObjMc">
  191. update biz_obj_mc
  192. <trim prefix="SET" suffixOverrides=",">
  193. <if test="objId != null">OBJ_ID =
  194. #{objId},
  195. </if>
  196. <if test="metricsId != null">METRICS_ID =
  197. #{metricsId},
  198. </if>
  199. <if test="metricsCode != null">METRICS_CODE =
  200. #{metricsCode},
  201. </if>
  202. <if test="alarmLow != null">ALARM_LOW =
  203. #{alarmLow},
  204. </if>
  205. <if test="alarmMid != null">ALARM_MID =
  206. #{alarmMid},
  207. </if>
  208. <if test="alarmHigh != null">ALARM_HIGH =
  209. #{alarmHigh},
  210. </if>
  211. <if test="event != null">EVENT =
  212. #{event},
  213. </if>
  214. <if test="dataExp != null">DATA_EXP =
  215. #{dataExp},
  216. </if>
  217. <if test="findKey != null">FIND_KEY =
  218. #{findKey},
  219. </if>
  220. <if test="findRule != null">FIND_RULE =
  221. #{findRule},
  222. </if>
  223. <if test="findFlag != null">FIND_FLAG =
  224. #{findFlag},
  225. </if>
  226. <if test="createBy != null">CREATE_BY =
  227. #{createBy},
  228. </if>
  229. <if test="createTime != null">CREATE_TIME =
  230. #{createTime},
  231. </if>
  232. <if test="updateBy != null">UPDATE_BY =
  233. #{updateBy},
  234. </if>
  235. <if test="updateTime != null">UPDATE_TIME =
  236. #{updateTime},
  237. </if>
  238. <if test="remark != null">REMARK =
  239. #{remark},
  240. </if>
  241. </trim>
  242. where MC_ID = #{mcId}
  243. </update>
  244. <delete id="deleteBizObjMcByMcId" parameterType="Long">
  245. delete
  246. from biz_obj_mc
  247. where MC_ID = #{mcId}
  248. </delete>
  249. <delete id="deleteBizObjMcByMcIds" parameterType="String">
  250. delete from biz_obj_mc where MC_ID in
  251. <foreach item="mcId" collection="array" open="(" separator="," close=")">
  252. #{mcId}
  253. </foreach>
  254. </delete>
  255. </mapper>