RankFiveMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.e3.zl.wc.dao.RankFiveMapper">
  4. <resultMap id="BaseResultMap" type="com.e3.zl.wc.model.RankFive">
  5. <id column="per_no" jdbcType="INTEGER" property="perNo" />
  6. <result column="per_num" jdbcType="INTEGER" property="perNum" />
  7. <result column="first_code" jdbcType="TINYINT" property="firstCode" />
  8. <result column="second_code" jdbcType="TINYINT" property="secondCode" />
  9. <result column="third_code" jdbcType="TINYINT" property="thirdCode" />
  10. <result column="fourth_code" jdbcType="TINYINT" property="fourthCode" />
  11. <result column="fifth_code" jdbcType="TINYINT" property="fifthCode" />
  12. </resultMap>
  13. <sql id="Example_Where_Clause">
  14. <where>
  15. <foreach collection="oredCriteria" item="criteria" separator="or">
  16. <if test="criteria.valid">
  17. <trim prefix="(" prefixOverrides="and" suffix=")">
  18. <foreach collection="criteria.criteria" item="criterion">
  19. <choose>
  20. <when test="criterion.noValue">
  21. and ${criterion.condition}
  22. </when>
  23. <when test="criterion.singleValue">
  24. and ${criterion.condition} #{criterion.value}
  25. </when>
  26. <when test="criterion.betweenValue">
  27. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  28. </when>
  29. <when test="criterion.listValue">
  30. and ${criterion.condition}
  31. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  32. #{listItem}
  33. </foreach>
  34. </when>
  35. </choose>
  36. </foreach>
  37. </trim>
  38. </if>
  39. </foreach>
  40. </where>
  41. </sql>
  42. <sql id="Base_Column_List">
  43. per_no, per_num, first_code, second_code, third_code, fourth_code, fifth_code
  44. </sql>
  45. <select id="selectByExample" parameterType="com.e3.zl.wc.model.RankFiveExample" resultMap="BaseResultMap">
  46. select
  47. <if test="distinct">
  48. distinct
  49. </if>
  50. 'false' as QUERYID,
  51. <include refid="Base_Column_List" />
  52. from rank_five
  53. <if test="_parameter != null">
  54. <include refid="Example_Where_Clause" />
  55. </if>
  56. <if test="orderByClause != null">
  57. order by ${orderByClause}
  58. </if>
  59. </select>
  60. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  61. select
  62. <include refid="Base_Column_List" />
  63. from rank_five
  64. where per_num = #{perNum,jdbcType=INTEGER}
  65. </select>
  66. <insert id="insert" parameterType="com.e3.zl.wc.model.RankFive">
  67. insert into rank_five (per_no, per_num, first_code,
  68. second_code, third_code, fourth_code,
  69. fifth_code)
  70. values (#{perNo,jdbcType=INTEGER}, #{perNum,jdbcType=INTEGER}, #{firstCode,jdbcType=TINYINT},
  71. #{secondCode,jdbcType=TINYINT}, #{thirdCode,jdbcType=TINYINT}, #{fourthCode,jdbcType=TINYINT},
  72. #{fifthCode,jdbcType=TINYINT})
  73. </insert>
  74. <insert id="insertSelective" parameterType="com.e3.zl.wc.model.RankFive">
  75. insert into rank_five
  76. <trim prefix="(" suffix=")" suffixOverrides=",">
  77. <if test="perNo != null">
  78. per_no,
  79. </if>
  80. <if test="perNum != null">
  81. per_num,
  82. </if>
  83. <if test="firstCode != null">
  84. first_code,
  85. </if>
  86. <if test="secondCode != null">
  87. second_code,
  88. </if>
  89. <if test="thirdCode != null">
  90. third_code,
  91. </if>
  92. <if test="fourthCode != null">
  93. fourth_code,
  94. </if>
  95. <if test="fifthCode != null">
  96. fifth_code,
  97. </if>
  98. </trim>
  99. <trim prefix="values (" suffix=")" suffixOverrides=",">
  100. <if test="perNo != null">
  101. #{perNo,jdbcType=INTEGER},
  102. </if>
  103. <if test="perNum != null">
  104. #{perNum,jdbcType=INTEGER},
  105. </if>
  106. <if test="firstCode != null">
  107. #{firstCode,jdbcType=TINYINT},
  108. </if>
  109. <if test="secondCode != null">
  110. #{secondCode,jdbcType=TINYINT},
  111. </if>
  112. <if test="thirdCode != null">
  113. #{thirdCode,jdbcType=TINYINT},
  114. </if>
  115. <if test="fourthCode != null">
  116. #{fourthCode,jdbcType=TINYINT},
  117. </if>
  118. <if test="fifthCode != null">
  119. #{fifthCode,jdbcType=TINYINT},
  120. </if>
  121. </trim>
  122. </insert>
  123. <update id="updateByPrimaryKeySelective" parameterType="com.e3.zl.wc.model.RankFive">
  124. update rank_five
  125. <set>
  126. <if test="perNum != null">
  127. per_num = #{perNum,jdbcType=INTEGER},
  128. </if>
  129. <if test="firstCode != null">
  130. first_code = #{firstCode,jdbcType=TINYINT},
  131. </if>
  132. <if test="secondCode != null">
  133. second_code = #{secondCode,jdbcType=TINYINT},
  134. </if>
  135. <if test="thirdCode != null">
  136. third_code = #{thirdCode,jdbcType=TINYINT},
  137. </if>
  138. <if test="fourthCode != null">
  139. fourth_code = #{fourthCode,jdbcType=TINYINT},
  140. </if>
  141. <if test="fifthCode != null">
  142. fifth_code = #{fifthCode,jdbcType=TINYINT},
  143. </if>
  144. </set>
  145. where per_no = #{perNo,jdbcType=INTEGER}
  146. </update>
  147. <update id="updateByPrimaryKey" parameterType="com.e3.zl.wc.model.RankFive">
  148. update rank_five
  149. set per_num = #{perNum,jdbcType=INTEGER},
  150. first_code = #{firstCode,jdbcType=TINYINT},
  151. second_code = #{secondCode,jdbcType=TINYINT},
  152. third_code = #{thirdCode,jdbcType=TINYINT},
  153. fourth_code = #{fourthCode,jdbcType=TINYINT},
  154. fifth_code = #{fifthCode,jdbcType=TINYINT}
  155. where per_no = #{perNo,jdbcType=INTEGER}
  156. </update>
  157. </mapper>