DicQuestionBankMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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.xinxin.topro.sysservice.dao.mysqlmapper.DicQuestionBankMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicQuestionBank" >
  5. <id column="DQB_ID" property="dqbId" jdbcType="INTEGER" />
  6. <result column="DQD_ID" property="dqdId" jdbcType="INTEGER" />
  7. <result column="DQB_Question" property="dqbQuestion" jdbcType="VARCHAR" />
  8. <result column="DQB_Type" property="dqbType" jdbcType="INTEGER" />
  9. <result column="DQB_Difficulty" property="dqbDifficulty" jdbcType="INTEGER" />
  10. <result column="DQB_Score" property="dqbScore" jdbcType="DOUBLE" />
  11. <result column="DQB_Remark" property="dqbRemark" jdbcType="VARCHAR" />
  12. <result column="DQB_PinyinCode" property="dqbPinyincode" jdbcType="VARCHAR" />
  13. <result column="DQB_WubiCode" property="dqbWubicode" jdbcType="VARCHAR" />
  14. <result column="DQB_OtherCode" property="dqbOthercode" jdbcType="VARCHAR" />
  15. <result column="DQB_Sort" property="dqbSort" jdbcType="INTEGER" />
  16. <result column="DQB_Operation_Time" property="dqbOperationTime" jdbcType="TIMESTAMP" />
  17. <result column="DQB_Operator" property="dqbOperator" jdbcType="VARCHAR" />
  18. <result column="DQB_IsDel" property="dqbIsdel" jdbcType="INTEGER" />
  19. </resultMap>
  20. <sql id="Base_Column_List" >
  21. DQB_ID, DQD_ID, DQB_Question, DQB_Type, DQB_Difficulty, DQB_Score, DQB_Remark, DQB_PinyinCode,
  22. DQB_WubiCode, DQB_OtherCode, DQB_Sort, DQB_Operation_Time, DQB_Operator, DQB_IsDel
  23. </sql>
  24. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  25. select
  26. <include refid="Base_Column_List" />
  27. from dic_question_bank
  28. where DQB_ID = #{dqbId,jdbcType=INTEGER}
  29. </select>
  30. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  31. delete from dic_question_bank
  32. where DQB_ID = #{dqbId,jdbcType=INTEGER}
  33. </delete>
  34. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicQuestionBank" keyProperty="dqbId" keyColumn="DQB_ID" useGeneratedKeys="true">
  35. insert into dic_question_bank (DQB_ID, DQD_ID, DQB_Question,
  36. DQB_Type, DQB_Difficulty, DQB_Score,
  37. DQB_Remark, DQB_PinyinCode, DQB_WubiCode,
  38. DQB_OtherCode, DQB_Sort, DQB_Operation_Time,
  39. DQB_Operator, DQB_IsDel)
  40. values (#{dqbId,jdbcType=INTEGER}, #{dqdId,jdbcType=INTEGER}, #{dqbQuestion,jdbcType=VARCHAR},
  41. #{dqbType,jdbcType=INTEGER}, #{dqbDifficulty,jdbcType=INTEGER}, #{dqbScore,jdbcType=DOUBLE},
  42. #{dqbRemark,jdbcType=VARCHAR}, #{dqbPinyincode,jdbcType=VARCHAR}, #{dqbWubicode,jdbcType=VARCHAR},
  43. #{dqbOthercode,jdbcType=VARCHAR}, #{dqbSort,jdbcType=INTEGER}, now(),
  44. #{dqbOperator,jdbcType=VARCHAR}, #{dqbIsdel,jdbcType=INTEGER})
  45. </insert>
  46. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicQuestionBank" >
  47. insert into dic_question_bank
  48. <trim prefix="(" suffix=")" suffixOverrides="," >
  49. <if test="dqbId != null" >
  50. DQB_ID,
  51. </if>
  52. <if test="dqdId != null" >
  53. DQD_ID,
  54. </if>
  55. <if test="dqbQuestion != null" >
  56. DQB_Question,
  57. </if>
  58. <if test="dqbType != null" >
  59. DQB_Type,
  60. </if>
  61. <if test="dqbDifficulty != null" >
  62. DQB_Difficulty,
  63. </if>
  64. <if test="dqbScore != null" >
  65. DQB_Score,
  66. </if>
  67. <if test="dqbRemark != null" >
  68. DQB_Remark,
  69. </if>
  70. <if test="dqbPinyincode != null" >
  71. DQB_PinyinCode,
  72. </if>
  73. <if test="dqbWubicode != null" >
  74. DQB_WubiCode,
  75. </if>
  76. <if test="dqbOthercode != null" >
  77. DQB_OtherCode,
  78. </if>
  79. <if test="dqbSort != null" >
  80. DQB_Sort,
  81. </if>
  82. <if test="dqbOperationTime != null" >
  83. DQB_Operation_Time,
  84. </if>
  85. <if test="dqbOperator != null" >
  86. DQB_Operator,
  87. </if>
  88. <if test="dqbIsdel != null" >
  89. DQB_IsDel,
  90. </if>
  91. </trim>
  92. <trim prefix="values (" suffix=")" suffixOverrides="," >
  93. <if test="dqbId != null" >
  94. #{dqbId,jdbcType=INTEGER},
  95. </if>
  96. <if test="dqdId != null" >
  97. #{dqdId,jdbcType=INTEGER},
  98. </if>
  99. <if test="dqbQuestion != null" >
  100. #{dqbQuestion,jdbcType=VARCHAR},
  101. </if>
  102. <if test="dqbType != null" >
  103. #{dqbType,jdbcType=INTEGER},
  104. </if>
  105. <if test="dqbDifficulty != null" >
  106. #{dqbDifficulty,jdbcType=INTEGER},
  107. </if>
  108. <if test="dqbScore != null" >
  109. #{dqbScore,jdbcType=DOUBLE},
  110. </if>
  111. <if test="dqbRemark != null" >
  112. #{dqbRemark,jdbcType=VARCHAR},
  113. </if>
  114. <if test="dqbPinyincode != null" >
  115. #{dqbPinyincode,jdbcType=VARCHAR},
  116. </if>
  117. <if test="dqbWubicode != null" >
  118. #{dqbWubicode,jdbcType=VARCHAR},
  119. </if>
  120. <if test="dqbOthercode != null" >
  121. #{dqbOthercode,jdbcType=VARCHAR},
  122. </if>
  123. <if test="dqbSort != null" >
  124. #{dqbSort,jdbcType=INTEGER},
  125. </if>
  126. <if test="dqbOperationTime != null" >
  127. #{dqbOperationTime,jdbcType=TIMESTAMP},
  128. </if>
  129. <if test="dqbOperator != null" >
  130. #{dqbOperator,jdbcType=VARCHAR},
  131. </if>
  132. <if test="dqbIsdel != null" >
  133. #{dqbIsdel,jdbcType=INTEGER},
  134. </if>
  135. </trim>
  136. </insert>
  137. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicQuestionBank" >
  138. update dic_question_bank
  139. <set >
  140. <if test="dqdId != null" >
  141. DQD_ID = #{dqdId,jdbcType=INTEGER},
  142. </if>
  143. <if test="dqbQuestion != null" >
  144. DQB_Question = #{dqbQuestion,jdbcType=VARCHAR},
  145. </if>
  146. <if test="dqbType != null" >
  147. DQB_Type = #{dqbType,jdbcType=INTEGER},
  148. </if>
  149. <if test="dqbDifficulty != null" >
  150. DQB_Difficulty = #{dqbDifficulty,jdbcType=INTEGER},
  151. </if>
  152. <if test="dqbScore != null" >
  153. DQB_Score = #{dqbScore,jdbcType=DOUBLE},
  154. </if>
  155. <if test="dqbRemark != null" >
  156. DQB_Remark = #{dqbRemark,jdbcType=VARCHAR},
  157. </if>
  158. <if test="dqbPinyincode != null" >
  159. DQB_PinyinCode = #{dqbPinyincode,jdbcType=VARCHAR},
  160. </if>
  161. <if test="dqbWubicode != null" >
  162. DQB_WubiCode = #{dqbWubicode,jdbcType=VARCHAR},
  163. </if>
  164. <if test="dqbOthercode != null" >
  165. DQB_OtherCode = #{dqbOthercode,jdbcType=VARCHAR},
  166. </if>
  167. <if test="dqbSort != null" >
  168. DQB_Sort = #{dqbSort,jdbcType=INTEGER},
  169. </if>
  170. <if test="dqbOperationTime != null" >
  171. DQB_Operation_Time = #{dqbOperationTime,jdbcType=TIMESTAMP},
  172. </if>
  173. <if test="dqbOperator != null" >
  174. DQB_Operator = #{dqbOperator,jdbcType=VARCHAR},
  175. </if>
  176. <if test="dqbIsdel != null" >
  177. DQB_IsDel = #{dqbIsdel,jdbcType=INTEGER},
  178. </if>
  179. </set>
  180. where DQB_ID = #{dqbId,jdbcType=INTEGER}
  181. </update>
  182. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicQuestionBank" >
  183. update dic_question_bank
  184. set
  185. DQB_Question = #{dqbQuestion,jdbcType=VARCHAR},
  186. DQB_Type = #{dqbType,jdbcType=INTEGER},
  187. DQB_Difficulty = #{dqbDifficulty,jdbcType=INTEGER},
  188. DQB_Score = #{dqbScore,jdbcType=DOUBLE},
  189. DQB_Remark = #{dqbRemark,jdbcType=VARCHAR},
  190. DQB_PinyinCode = #{dqbPinyincode,jdbcType=VARCHAR},
  191. DQB_WubiCode = #{dqbWubicode,jdbcType=VARCHAR},
  192. DQB_OtherCode = #{dqbOthercode,jdbcType=VARCHAR},
  193. DQB_Sort = #{dqbSort,jdbcType=INTEGER},
  194. DQB_Operation_Time = now(),
  195. DQB_Operator = #{dqbOperator,jdbcType=VARCHAR}
  196. where DQB_ID = #{dqbId,jdbcType=INTEGER}
  197. </update>
  198. <select id="selectBankById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  199. SELECT
  200. <include refid="Base_Column_List" />
  201. FROM
  202. dic_question_bank
  203. WHERE
  204. DQD_ID = #{dqdId,jdbcType=INTEGER}
  205. and DQB_IsDel = 0
  206. order by DQB_Sort
  207. </select>
  208. <update id="updateDel" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicQuestionBank" >
  209. update dic_question_bank
  210. set
  211. DQB_IsDel = #{dqbIsdel,jdbcType=INTEGER},
  212. DQB_Operation_Time = now(),
  213. DQB_Operator = #{dqbOperator,jdbcType=VARCHAR}
  214. where DQB_ID = #{dqbId,jdbcType=INTEGER}
  215. </update>
  216. </mapper>