TLqdataMapper.xml 13 KB

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