SentenceQuestionRelationMapper.xml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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.qxgmat.data.relation.SentenceQuestionRelationMapper">
  4. <resultMap id="IdMap" type="com.qxgmat.data.dao.entity.SentenceQuestion">
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="id" jdbcType="INTEGER" property="id" />
  9. </resultMap>
  10. <sql id="Id_Column_List">
  11. <!--
  12. WARNING - @mbg.generated
  13. -->
  14. sq.`id`
  15. </sql>
  16. <!--累加做题记录-->
  17. <update id="accumulation">
  18. UPDATE `sentence_question`
  19. <trim prefix="set" suffixOverrides=",">
  20. `total_number`=`total_number`+#{number, jdbcType=INTEGER},
  21. `total_time`=`total_time`+#{time, jdbcType=INTEGER},
  22. `total_correct`=`total_correct`+#{correct, jdbcType=INTEGER},
  23. </trim>
  24. WHERE `id` = #{id, jdbcType=VARCHAR}
  25. </update>
  26. <!--累加收藏记录-->
  27. <update id="accumulationCollect">
  28. UPDATE `sentence_question`
  29. <trim prefix="set" suffixOverrides=",">
  30. `collect_number`=`collect_number`+#{collect, jdbcType=INTEGER},
  31. </trim>
  32. WHERE `id` = #{id, jdbcType=VARCHAR}
  33. </update>
  34. </mapper>