TDcsdataMapper.xml 9.0 KB

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