TActkindHistoryMapper.xml 8.0 KB

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