TActkindMapper.xml 7.6 KB

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