TTestdataLayerMapper.xml 9.6 KB

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