TestPaperLibaryMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.ghsc.partybuild.mapper.TestPaperLibaryMapper">
  4. <resultMap id="BaseResultMap" type="com.ghsc.partybuild.model.TestPaperLibary">
  5. <id column="test_paper_libary_id" jdbcType="VARCHAR" property="testPaperLibaryId" />
  6. <result column="test_paper_id" jdbcType="VARCHAR" property="testPaperId" />
  7. <result column="test_question_libary_id" jdbcType="VARCHAR" property="testQuestionLibaryId" />
  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="(" prefixOverrides="and" suffix=")">
  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 close=")" collection="criterion.value" item="listItem" open="(" 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="(" prefixOverrides="and" suffix=")">
  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 close=")" collection="criterion.value" item="listItem" open="(" 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. test_paper_libary_id, test_paper_id, test_question_libary_id
  69. </sql>
  70. <select id="selectByExample" parameterType="com.ghsc.partybuild.model.TestPaperLibaryExample" resultMap="BaseResultMap">
  71. select
  72. <if test="distinct">
  73. distinct
  74. </if>
  75. <include refid="Base_Column_List" />
  76. from test_paper_libary
  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. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  85. select
  86. <include refid="Base_Column_List" />
  87. from test_paper_libary
  88. where test_paper_libary_id = #{testPaperLibaryId,jdbcType=VARCHAR}
  89. </select>
  90. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  91. delete from test_paper_libary
  92. where test_paper_libary_id = #{testPaperLibaryId,jdbcType=VARCHAR}
  93. </delete>
  94. <delete id="deleteByExample" parameterType="com.ghsc.partybuild.model.TestPaperLibaryExample">
  95. delete from test_paper_libary
  96. <if test="_parameter != null">
  97. <include refid="Example_Where_Clause" />
  98. </if>
  99. </delete>
  100. <insert id="insert" parameterType="com.ghsc.partybuild.model.TestPaperLibary">
  101. insert into test_paper_libary (test_paper_libary_id, test_paper_id, test_question_libary_id
  102. )
  103. values (#{testPaperLibaryId,jdbcType=VARCHAR}, #{testPaperId,jdbcType=VARCHAR}, #{testQuestionLibaryId,jdbcType=VARCHAR}
  104. )
  105. </insert>
  106. <insert id="insertSelective" parameterType="com.ghsc.partybuild.model.TestPaperLibary">
  107. insert into test_paper_libary
  108. <trim prefix="(" suffix=")" suffixOverrides=",">
  109. <if test="testPaperLibaryId != null">
  110. test_paper_libary_id,
  111. </if>
  112. <if test="testPaperId != null">
  113. test_paper_id,
  114. </if>
  115. <if test="testQuestionLibaryId != null">
  116. test_question_libary_id,
  117. </if>
  118. </trim>
  119. <trim prefix="values (" suffix=")" suffixOverrides=",">
  120. <if test="testPaperLibaryId != null">
  121. #{testPaperLibaryId,jdbcType=VARCHAR},
  122. </if>
  123. <if test="testPaperId != null">
  124. #{testPaperId,jdbcType=VARCHAR},
  125. </if>
  126. <if test="testQuestionLibaryId != null">
  127. #{testQuestionLibaryId,jdbcType=VARCHAR},
  128. </if>
  129. </trim>
  130. </insert>
  131. <select id="countByExample" parameterType="com.ghsc.partybuild.model.TestPaperLibaryExample" resultType="java.lang.Long">
  132. select count(*) from test_paper_libary
  133. <if test="_parameter != null">
  134. <include refid="Example_Where_Clause" />
  135. </if>
  136. </select>
  137. <update id="updateByExampleSelective" parameterType="map">
  138. update test_paper_libary
  139. <set>
  140. <if test="record.testPaperLibaryId != null">
  141. test_paper_libary_id = #{record.testPaperLibaryId,jdbcType=VARCHAR},
  142. </if>
  143. <if test="record.testPaperId != null">
  144. test_paper_id = #{record.testPaperId,jdbcType=VARCHAR},
  145. </if>
  146. <if test="record.testQuestionLibaryId != null">
  147. test_question_libary_id = #{record.testQuestionLibaryId,jdbcType=VARCHAR},
  148. </if>
  149. </set>
  150. <if test="_parameter != null">
  151. <include refid="Update_By_Example_Where_Clause" />
  152. </if>
  153. </update>
  154. <update id="updateByExample" parameterType="map">
  155. update test_paper_libary
  156. set test_paper_libary_id = #{record.testPaperLibaryId,jdbcType=VARCHAR},
  157. test_paper_id = #{record.testPaperId,jdbcType=VARCHAR},
  158. test_question_libary_id = #{record.testQuestionLibaryId,jdbcType=VARCHAR}
  159. <if test="_parameter != null">
  160. <include refid="Update_By_Example_Where_Clause" />
  161. </if>
  162. </update>
  163. <update id="updateByPrimaryKeySelective" parameterType="com.ghsc.partybuild.model.TestPaperLibary">
  164. update test_paper_libary
  165. <set>
  166. <if test="testPaperId != null">
  167. test_paper_id = #{testPaperId,jdbcType=VARCHAR},
  168. </if>
  169. <if test="testQuestionLibaryId != null">
  170. test_question_libary_id = #{testQuestionLibaryId,jdbcType=VARCHAR},
  171. </if>
  172. </set>
  173. where test_paper_libary_id = #{testPaperLibaryId,jdbcType=VARCHAR}
  174. </update>
  175. <update id="updateByPrimaryKey" parameterType="com.ghsc.partybuild.model.TestPaperLibary">
  176. update test_paper_libary
  177. set test_paper_id = #{testPaperId,jdbcType=VARCHAR},
  178. test_question_libary_id = #{testQuestionLibaryId,jdbcType=VARCHAR}
  179. where test_paper_libary_id = #{testPaperLibaryId,jdbcType=VARCHAR}
  180. </update>
  181. </mapper>