TWarningThresholdHistoryMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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.grainsituation.mapper.TWarningThresholdHistoryMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHistory" >
  5. <result column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="org_id" property="orgId" jdbcType="VARCHAR" />
  7. <result column="v_cf_code" property="vCfCode" jdbcType="VARCHAR" />
  8. <result column="w_module" property="wModule" jdbcType="VARCHAR" />
  9. <result column="w_name" property="wName" jdbcType="VARCHAR" />
  10. <result column="w_threshold" property="wThreshold" jdbcType="DECIMAL" />
  11. <result column="threshold" property="threshold" jdbcType="DECIMAL" />
  12. <result column="w_state" property="wState" jdbcType="INTEGER" />
  13. <result column="w_time" property="wTime" jdbcType="TIMESTAMP" />
  14. <result column="w_update_time" property="wUpdateTime" jdbcType="TIMESTAMP" />
  15. <result column="data_source" property="dataSource" jdbcType="VARCHAR" />
  16. <result column="w_remark" property="wRemark" jdbcType="VARCHAR" />
  17. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  18. <result column="is_send" property="isSend" jdbcType="VARCHAR" />
  19. <result column="w_mode" property="wMode" jdbcType="VARCHAR" />
  20. <result column="w_warning" property="wWarning" jdbcType="VARCHAR" />
  21. </resultMap>
  22. <sql id="Example_Where_Clause" >
  23. <where >
  24. <foreach collection="oredCriteria" item="criteria" separator="or" >
  25. <if test="criteria.valid" >
  26. <trim prefix="(" suffix=")" prefixOverrides="and" >
  27. <foreach collection="criteria.criteria" item="criterion" >
  28. <choose >
  29. <when test="criterion.noValue" >
  30. and ${criterion.condition}
  31. </when>
  32. <when test="criterion.singleValue" >
  33. and ${criterion.condition} #{criterion.value}
  34. </when>
  35. <when test="criterion.betweenValue" >
  36. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  37. </when>
  38. <when test="criterion.listValue" >
  39. and ${criterion.condition}
  40. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  41. #{listItem}
  42. </foreach>
  43. </when>
  44. </choose>
  45. </foreach>
  46. </trim>
  47. </if>
  48. </foreach>
  49. </where>
  50. </sql>
  51. <sql id="Update_By_Example_Where_Clause" >
  52. <where >
  53. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  54. <if test="criteria.valid" >
  55. <trim prefix="(" suffix=")" prefixOverrides="and" >
  56. <foreach collection="criteria.criteria" item="criterion" >
  57. <choose >
  58. <when test="criterion.noValue" >
  59. and ${criterion.condition}
  60. </when>
  61. <when test="criterion.singleValue" >
  62. and ${criterion.condition} #{criterion.value}
  63. </when>
  64. <when test="criterion.betweenValue" >
  65. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  66. </when>
  67. <when test="criterion.listValue" >
  68. and ${criterion.condition}
  69. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  70. #{listItem}
  71. </foreach>
  72. </when>
  73. </choose>
  74. </foreach>
  75. </trim>
  76. </if>
  77. </foreach>
  78. </where>
  79. </sql>
  80. <sql id="Base_Column_List" >
  81. id, org_id, v_cf_code, w_module, w_name, w_threshold, threshold, w_state, w_time,
  82. w_update_time, data_source, w_remark, updatetime, is_send, w_mode, w_warning
  83. </sql>
  84. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHistoryExample" >
  85. select
  86. <if test="distinct" >
  87. distinct
  88. </if>
  89. <include refid="Base_Column_List" />
  90. from t_warning_threshold_history
  91. <if test="_parameter != null" >
  92. <include refid="Example_Where_Clause" />
  93. </if>
  94. <if test="orderByClause != null" >
  95. order by ${orderByClause}
  96. </if>
  97. </select>
  98. <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHistoryExample" >
  99. delete from t_warning_threshold_history
  100. <if test="_parameter != null" >
  101. <include refid="Example_Where_Clause" />
  102. </if>
  103. </delete>
  104. <insert id="insert" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHistory" >
  105. insert into t_warning_threshold_history (id, org_id, v_cf_code,
  106. w_module, w_name, w_threshold,
  107. threshold, w_state, w_time,
  108. w_update_time, data_source, w_remark,
  109. updatetime, is_send, w_mode,
  110. w_warning)
  111. values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{vCfCode,jdbcType=VARCHAR},
  112. #{wModule,jdbcType=VARCHAR}, #{wName,jdbcType=VARCHAR}, #{wThreshold,jdbcType=DECIMAL},
  113. #{threshold,jdbcType=DECIMAL}, #{wState,jdbcType=INTEGER}, #{wTime,jdbcType=TIMESTAMP},
  114. #{wUpdateTime,jdbcType=TIMESTAMP}, #{dataSource,jdbcType=VARCHAR}, #{wRemark,jdbcType=VARCHAR},
  115. #{updatetime,jdbcType=TIMESTAMP}, #{isSend,jdbcType=VARCHAR}, #{wMode,jdbcType=VARCHAR},
  116. #{wWarning,jdbcType=VARCHAR})
  117. </insert>
  118. <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHistory" >
  119. insert into t_warning_threshold_history
  120. <trim prefix="(" suffix=")" suffixOverrides="," >
  121. <if test="id != null" >
  122. id,
  123. </if>
  124. <if test="orgId != null" >
  125. org_id,
  126. </if>
  127. <if test="vCfCode != null" >
  128. v_cf_code,
  129. </if>
  130. <if test="wModule != null" >
  131. w_module,
  132. </if>
  133. <if test="wName != null" >
  134. w_name,
  135. </if>
  136. <if test="wThreshold != null" >
  137. w_threshold,
  138. </if>
  139. <if test="threshold != null" >
  140. threshold,
  141. </if>
  142. <if test="wState != null" >
  143. w_state,
  144. </if>
  145. <if test="wTime != null" >
  146. w_time,
  147. </if>
  148. <if test="wUpdateTime != null" >
  149. w_update_time,
  150. </if>
  151. <if test="dataSource != null" >
  152. data_source,
  153. </if>
  154. <if test="wRemark != null" >
  155. w_remark,
  156. </if>
  157. <if test="updatetime != null" >
  158. updatetime,
  159. </if>
  160. <if test="isSend != null" >
  161. is_send,
  162. </if>
  163. <if test="wMode != null" >
  164. w_mode,
  165. </if>
  166. <if test="wWarning != null" >
  167. w_warning,
  168. </if>
  169. </trim>
  170. <trim prefix="values (" suffix=")" suffixOverrides="," >
  171. <if test="id != null" >
  172. #{id,jdbcType=VARCHAR},
  173. </if>
  174. <if test="orgId != null" >
  175. #{orgId,jdbcType=VARCHAR},
  176. </if>
  177. <if test="vCfCode != null" >
  178. #{vCfCode,jdbcType=VARCHAR},
  179. </if>
  180. <if test="wModule != null" >
  181. #{wModule,jdbcType=VARCHAR},
  182. </if>
  183. <if test="wName != null" >
  184. #{wName,jdbcType=VARCHAR},
  185. </if>
  186. <if test="wThreshold != null" >
  187. #{wThreshold,jdbcType=DECIMAL},
  188. </if>
  189. <if test="threshold != null" >
  190. #{threshold,jdbcType=DECIMAL},
  191. </if>
  192. <if test="wState != null" >
  193. #{wState,jdbcType=INTEGER},
  194. </if>
  195. <if test="wTime != null" >
  196. #{wTime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="wUpdateTime != null" >
  199. #{wUpdateTime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="dataSource != null" >
  202. #{dataSource,jdbcType=VARCHAR},
  203. </if>
  204. <if test="wRemark != null" >
  205. #{wRemark,jdbcType=VARCHAR},
  206. </if>
  207. <if test="updatetime != null" >
  208. #{updatetime,jdbcType=TIMESTAMP},
  209. </if>
  210. <if test="isSend != null" >
  211. #{isSend,jdbcType=VARCHAR},
  212. </if>
  213. <if test="wMode != null" >
  214. #{wMode,jdbcType=VARCHAR},
  215. </if>
  216. <if test="wWarning != null" >
  217. #{wWarning,jdbcType=VARCHAR},
  218. </if>
  219. </trim>
  220. </insert>
  221. <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHistoryExample" resultType="java.lang.Integer" >
  222. select count(*) from t_warning_threshold_history
  223. <if test="_parameter != null" >
  224. <include refid="Example_Where_Clause" />
  225. </if>
  226. </select>
  227. <update id="updateByExampleSelective" parameterType="map" >
  228. update t_warning_threshold_history
  229. <set >
  230. <if test="record.id != null" >
  231. id = #{record.id,jdbcType=VARCHAR},
  232. </if>
  233. <if test="record.orgId != null" >
  234. org_id = #{record.orgId,jdbcType=VARCHAR},
  235. </if>
  236. <if test="record.vCfCode != null" >
  237. v_cf_code = #{record.vCfCode,jdbcType=VARCHAR},
  238. </if>
  239. <if test="record.wModule != null" >
  240. w_module = #{record.wModule,jdbcType=VARCHAR},
  241. </if>
  242. <if test="record.wName != null" >
  243. w_name = #{record.wName,jdbcType=VARCHAR},
  244. </if>
  245. <if test="record.wThreshold != null" >
  246. w_threshold = #{record.wThreshold,jdbcType=DECIMAL},
  247. </if>
  248. <if test="record.threshold != null" >
  249. threshold = #{record.threshold,jdbcType=DECIMAL},
  250. </if>
  251. <if test="record.wState != null" >
  252. w_state = #{record.wState,jdbcType=INTEGER},
  253. </if>
  254. <if test="record.wTime != null" >
  255. w_time = #{record.wTime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="record.wUpdateTime != null" >
  258. w_update_time = #{record.wUpdateTime,jdbcType=TIMESTAMP},
  259. </if>
  260. <if test="record.dataSource != null" >
  261. data_source = #{record.dataSource,jdbcType=VARCHAR},
  262. </if>
  263. <if test="record.wRemark != null" >
  264. w_remark = #{record.wRemark,jdbcType=VARCHAR},
  265. </if>
  266. <if test="record.updatetime != null" >
  267. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  268. </if>
  269. <if test="record.isSend != null" >
  270. is_send = #{record.isSend,jdbcType=VARCHAR},
  271. </if>
  272. <if test="record.wMode != null" >
  273. w_mode = #{record.wMode,jdbcType=VARCHAR},
  274. </if>
  275. <if test="record.wWarning != null" >
  276. w_warning = #{record.wWarning,jdbcType=VARCHAR},
  277. </if>
  278. </set>
  279. <if test="_parameter != null" >
  280. <include refid="Update_By_Example_Where_Clause" />
  281. </if>
  282. </update>
  283. <update id="updateByExample" parameterType="map" >
  284. update t_warning_threshold_history
  285. set id = #{record.id,jdbcType=VARCHAR},
  286. org_id = #{record.orgId,jdbcType=VARCHAR},
  287. v_cf_code = #{record.vCfCode,jdbcType=VARCHAR},
  288. w_module = #{record.wModule,jdbcType=VARCHAR},
  289. w_name = #{record.wName,jdbcType=VARCHAR},
  290. w_threshold = #{record.wThreshold,jdbcType=DECIMAL},
  291. threshold = #{record.threshold,jdbcType=DECIMAL},
  292. w_state = #{record.wState,jdbcType=INTEGER},
  293. w_time = #{record.wTime,jdbcType=TIMESTAMP},
  294. w_update_time = #{record.wUpdateTime,jdbcType=TIMESTAMP},
  295. data_source = #{record.dataSource,jdbcType=VARCHAR},
  296. w_remark = #{record.wRemark,jdbcType=VARCHAR},
  297. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  298. is_send = #{record.isSend,jdbcType=VARCHAR},
  299. w_mode = #{record.wMode,jdbcType=VARCHAR},
  300. w_warning = #{record.wWarning,jdbcType=VARCHAR}
  301. <if test="_parameter != null" >
  302. <include refid="Update_By_Example_Where_Clause" />
  303. </if>
  304. </update>
  305. <insert id="insertBatch" parameterType="java.util.List">
  306. insert into t_warning_threshold_history (id, org_id, v_cf_code,
  307. w_module, w_name, w_threshold,
  308. threshold, w_state, w_time,
  309. w_update_time, data_source, w_remark,
  310. updatetime, is_send, w_mode,
  311. w_warning)
  312. values
  313. <foreach collection="list" item="th" index="index" separator=",">
  314. (#{th.id,jdbcType=VARCHAR}, #{th.orgId,jdbcType=VARCHAR}, #{th.vCfCode,jdbcType=VARCHAR},
  315. #{th.wModule,jdbcType=VARCHAR}, #{th.wName,jdbcType=VARCHAR}, #{th.wThreshold,jdbcType=DECIMAL},
  316. #{th.threshold,jdbcType=DECIMAL}, #{th.wState,jdbcType=INTEGER}, #{th.wTime,jdbcType=TIMESTAMP},
  317. #{th.wUpdateTime,jdbcType=TIMESTAMP}, #{th.dataSource,jdbcType=VARCHAR}, #{th.wRemark,jdbcType=VARCHAR},
  318. #{th.updatetime,jdbcType=TIMESTAMP}, #{th.isSend,jdbcType=VARCHAR}, #{th.wMode,jdbcType=VARCHAR},
  319. #{th.wWarning,jdbcType=VARCHAR})
  320. </foreach>
  321. </insert>
  322. </mapper>