TStatueMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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.basicdata.mapper.TStatueMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.basicdata.model.TStatue" >
  5. <result column="vStatueCode" property="vstatuecode" jdbcType="VARCHAR" />
  6. <result column="vStatueName" property="vstatuename" jdbcType="VARCHAR" />
  7. <result column="vRemark" property="vremark" jdbcType="VARCHAR" />
  8. </resultMap>
  9. <sql id="Example_Where_Clause" >
  10. <where >
  11. <foreach collection="oredCriteria" item="criteria" separator="or" >
  12. <if test="criteria.valid" >
  13. <trim prefix="(" suffix=")" prefixOverrides="and" >
  14. <foreach collection="criteria.criteria" item="criterion" >
  15. <choose >
  16. <when test="criterion.noValue" >
  17. and ${criterion.condition}
  18. </when>
  19. <when test="criterion.singleValue" >
  20. and ${criterion.condition} #{criterion.value}
  21. </when>
  22. <when test="criterion.betweenValue" >
  23. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  24. </when>
  25. <when test="criterion.listValue" >
  26. and ${criterion.condition}
  27. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  28. #{listItem}
  29. </foreach>
  30. </when>
  31. </choose>
  32. </foreach>
  33. </trim>
  34. </if>
  35. </foreach>
  36. </where>
  37. </sql>
  38. <sql id="Update_By_Example_Where_Clause" >
  39. <where >
  40. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  41. <if test="criteria.valid" >
  42. <trim prefix="(" suffix=")" prefixOverrides="and" >
  43. <foreach collection="criteria.criteria" item="criterion" >
  44. <choose >
  45. <when test="criterion.noValue" >
  46. and ${criterion.condition}
  47. </when>
  48. <when test="criterion.singleValue" >
  49. and ${criterion.condition} #{criterion.value}
  50. </when>
  51. <when test="criterion.betweenValue" >
  52. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  53. </when>
  54. <when test="criterion.listValue" >
  55. and ${criterion.condition}
  56. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  57. #{listItem}
  58. </foreach>
  59. </when>
  60. </choose>
  61. </foreach>
  62. </trim>
  63. </if>
  64. </foreach>
  65. </where>
  66. </sql>
  67. <sql id="Base_Column_List" >
  68. vStatueCode, vStatueName, vRemark
  69. </sql>
  70. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TStatueExample" >
  71. select
  72. <if test="distinct" >
  73. distinct
  74. </if>
  75. <include refid="Base_Column_List" />
  76. from t_statue
  77. <if test="_parameter != null" >
  78. <include refid="Example_Where_Clause" />
  79. </if>
  80. <if test="orderByClause != null" >
  81. order by ${orderByClause}
  82. </if>
  83. </select>
  84. <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TStatueExample" >
  85. delete from t_statue
  86. <if test="_parameter != null" >
  87. <include refid="Example_Where_Clause" />
  88. </if>
  89. </delete>
  90. <insert id="insert" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TStatue" >
  91. insert into t_statue (vStatueCode, vStatueName, vRemark
  92. )
  93. values (#{vstatuecode,jdbcType=VARCHAR}, #{vstatuename,jdbcType=VARCHAR}, #{vremark,jdbcType=VARCHAR}
  94. )
  95. </insert>
  96. <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TStatue" >
  97. insert into t_statue
  98. <trim prefix="(" suffix=")" suffixOverrides="," >
  99. <if test="vstatuecode != null" >
  100. vStatueCode,
  101. </if>
  102. <if test="vstatuename != null" >
  103. vStatueName,
  104. </if>
  105. <if test="vremark != null" >
  106. vRemark,
  107. </if>
  108. </trim>
  109. <trim prefix="values (" suffix=")" suffixOverrides="," >
  110. <if test="vstatuecode != null" >
  111. #{vstatuecode,jdbcType=VARCHAR},
  112. </if>
  113. <if test="vstatuename != null" >
  114. #{vstatuename,jdbcType=VARCHAR},
  115. </if>
  116. <if test="vremark != null" >
  117. #{vremark,jdbcType=VARCHAR},
  118. </if>
  119. </trim>
  120. </insert>
  121. <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TStatueExample" resultType="java.lang.Integer" >
  122. select count(*) from t_statue
  123. <if test="_parameter != null" >
  124. <include refid="Example_Where_Clause" />
  125. </if>
  126. </select>
  127. <update id="updateByExampleSelective" parameterType="map" >
  128. update t_statue
  129. <set >
  130. <if test="record.vstatuecode != null" >
  131. vStatueCode = #{record.vstatuecode,jdbcType=VARCHAR},
  132. </if>
  133. <if test="record.vstatuename != null" >
  134. vStatueName = #{record.vstatuename,jdbcType=VARCHAR},
  135. </if>
  136. <if test="record.vremark != null" >
  137. vRemark = #{record.vremark,jdbcType=VARCHAR},
  138. </if>
  139. </set>
  140. <if test="_parameter != null" >
  141. <include refid="Update_By_Example_Where_Clause" />
  142. </if>
  143. </update>
  144. <update id="updateByExample" parameterType="map" >
  145. update t_statue
  146. set vStatueCode = #{record.vstatuecode,jdbcType=VARCHAR},
  147. vStatueName = #{record.vstatuename,jdbcType=VARCHAR},
  148. vRemark = #{record.vremark,jdbcType=VARCHAR}
  149. <if test="_parameter != null" >
  150. <include refid="Update_By_Example_Where_Clause" />
  151. </if>
  152. </update>
  153. </mapper>