SyTestExamineeMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.sy.mapper.SyTestExamineeMapper">
  6. <resultMap type="SyTestExaminee" id="SyTestExamineeResult">
  7. <result property="examineeId" column="examinee_id" />
  8. <result property="paperId" column="paper_id" />
  9. <result property="round" column="round" />
  10. <result property="customerCode" column="customer_code" />
  11. <result property="beginTime" column="begin_time" />
  12. <result property="endTime" column="end_time" />
  13. <result property="state" column="state" />
  14. <result property="scoreLevel" column="score_level" />
  15. <result property="score" column="score" />
  16. <result property="scoreRate" column="score_rate" />
  17. <result property="ranking" column="ranking" />
  18. <result property="stats" column="stats" />
  19. </resultMap>
  20. <sql id="selectSyTestExamineeVo">
  21. select examinee_id, paper_id, round, customer_code, begin_time, end_time, state, score_level, score, score_rate, ranking, stats from sy_test_examinee
  22. </sql>
  23. <select id="selectSyTestExamineeLatest" parameterType="map" resultMap="SyTestExamineeResult">
  24. <include refid="selectSyTestExamineeVo"/>
  25. <where>
  26. <if test="paperId != null "> and paper_id = #{paperId}</if>
  27. <if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
  28. <if test="state != null "> and state = #{state}</if>
  29. <if test="states != null "> and state in <foreach item="o" collection="states" open="(" separator="," close=")">#{o}</foreach></if>
  30. </where>
  31. order by examinee_id desc
  32. <if test="cnt != null "> limit #{cnt}</if>
  33. </select>
  34. <select id="selectSyTestExamineeList" parameterType="SyTestExaminee" resultMap="SyTestExamineeResult">
  35. <include refid="selectSyTestExamineeVo"/>
  36. <where>
  37. <if test="paperId != null "> and paper_id = #{paperId}</if>
  38. <if test="round != null "> and round = #{round}</if>
  39. <if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
  40. <if test="beginTime != null "> and begin_time = #{beginTime}</if>
  41. <if test="endTime != null "> and end_time = #{endTime}</if>
  42. <if test="state != null "> and state = #{state}</if>
  43. <if test="scoreLevel != null and scoreLevel != ''"> and score_level = #{scoreLevel}</if>
  44. <if test="score != null "> and score = #{score}</if>
  45. <if test="scoreRate != null "> and score_rate = #{scoreRate}</if>
  46. <if test="ranking != null "> and ranking = #{ranking}</if>
  47. <if test="stats != null and stats != ''"> and stats = #{stats}</if>
  48. </where>
  49. ORDER BY examinee_id DESC
  50. </select>
  51. <select id="selectSyTestExamineeById" parameterType="Long" resultMap="SyTestExamineeResult">
  52. <include refid="selectSyTestExamineeVo"/>
  53. where examinee_id = #{examineeId}
  54. </select>
  55. <insert id="insertSyTestExaminee" parameterType="SyTestExaminee" useGeneratedKeys="true" keyProperty="examineeId">
  56. insert into sy_test_examinee
  57. <trim prefix="(" suffix=")" suffixOverrides=",">
  58. <if test="paperId != null">paper_id,</if>
  59. <if test="round != null">round,</if>
  60. <if test="customerCode != null">customer_code,</if>
  61. <if test="beginTime != null">begin_time,</if>
  62. <if test="endTime != null">end_time,</if>
  63. <if test="state != null">state,</if>
  64. <if test="scoreLevel != null">score_level,</if>
  65. <if test="score != null">score,</if>
  66. <if test="scoreRate != null">score_rate,</if>
  67. <if test="ranking != null">ranking,</if>
  68. <if test="stats != null">stats,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="paperId != null">#{paperId},</if>
  72. <if test="round != null">#{round},</if>
  73. <if test="customerCode != null">#{customerCode},</if>
  74. <if test="beginTime != null">#{beginTime},</if>
  75. <if test="endTime != null">#{endTime},</if>
  76. <if test="state != null">#{state},</if>
  77. <if test="scoreLevel != null">#{scoreLevel},</if>
  78. <if test="score != null">#{score},</if>
  79. <if test="scoreRate != null">#{scoreRate},</if>
  80. <if test="ranking != null">#{ranking},</if>
  81. <if test="stats != null">#{stats},</if>
  82. </trim>
  83. </insert>
  84. <update id="updateSyTestExaminee" parameterType="SyTestExaminee">
  85. update sy_test_examinee
  86. <trim prefix="SET" suffixOverrides=",">
  87. <if test="paperId != null">paper_id = #{paperId},</if>
  88. <if test="round != null">round = #{round},</if>
  89. <if test="customerCode != null">customer_code = #{customerCode},</if>
  90. <if test="beginTime != null">begin_time = #{beginTime},</if>
  91. <if test="endTime != null">end_time = #{endTime},</if>
  92. <if test="state != null">state = #{state},</if>
  93. <if test="scoreLevel != null">score_level = #{scoreLevel},</if>
  94. <if test="score != null">score = #{score},</if>
  95. <if test="scoreRate != null">score_rate = #{scoreRate},</if>
  96. <if test="ranking != null">ranking = #{ranking},</if>
  97. <if test="stats != null">stats = #{stats},</if>
  98. </trim>
  99. where examinee_id = #{examineeId}
  100. </update>
  101. <delete id="deleteSyTestExamineeById" parameterType="Long">
  102. delete from sy_test_examinee where examinee_id = #{examineeId}
  103. </delete>
  104. <delete id="deleteSyTestExamineeByIds" parameterType="String">
  105. delete from sy_test_examinee where examinee_id in
  106. <foreach item="examineeId" collection="array" open="(" separator="," close=")">
  107. #{examineeId}
  108. </foreach>
  109. </delete>
  110. </mapper>