xiangpei
2024-05-31 c9d04bc519b73f7fc4841c34e2f15fca9db7aad2
src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml
@@ -19,204 +19,11 @@
    <result column="item_order" jdbcType="INTEGER" property="itemOrder" />
  </resultMap>
  <sql id="Base_Column_List">
    id, question_id, exam_paper_id, exam_paper_answer_id, question_type, subject_id,
        id
        , question_id, exam_paper_id, exam_paper_answer_id, question_type, subject_id,
    customer_score, question_score, question_text_content_id, answer, text_content_id,
    do_right, create_user, create_time, item_order
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_exam_paper_question_customer_answer
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_exam_paper_question_customer_answer
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
    insert into t_exam_paper_question_customer_answer (id, question_id, exam_paper_id,
      exam_paper_answer_id, question_type, subject_id,
      customer_score, question_score, question_text_content_id,
      answer, text_content_id, do_right,
      create_user, create_time, item_order
      )
    values (#{id,jdbcType=INTEGER}, #{questionId,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER},
      #{examPaperAnswerId,jdbcType=INTEGER}, #{questionType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER},
      #{customerScore,jdbcType=INTEGER}, #{questionScore,jdbcType=INTEGER}, #{questionTextContentId,jdbcType=INTEGER},
      #{answer,jdbcType=VARCHAR}, #{textContentId,jdbcType=INTEGER}, #{doRight,jdbcType=BIT},
      #{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{itemOrder,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
    insert into t_exam_paper_question_customer_answer
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="questionId != null">
        question_id,
      </if>
      <if test="examPaperId != null">
        exam_paper_id,
      </if>
      <if test="examPaperAnswerId != null">
        exam_paper_answer_id,
      </if>
      <if test="questionType != null">
        question_type,
      </if>
      <if test="subjectId != null">
        subject_id,
      </if>
      <if test="customerScore != null">
        customer_score,
      </if>
      <if test="questionScore != null">
        question_score,
      </if>
      <if test="questionTextContentId != null">
        question_text_content_id,
      </if>
      <if test="answer != null">
        answer,
      </if>
      <if test="textContentId != null">
        text_content_id,
      </if>
      <if test="doRight != null">
        do_right,
      </if>
      <if test="createUser != null">
        create_user,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="itemOrder != null">
        item_order,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="questionId != null">
        #{questionId,jdbcType=INTEGER},
      </if>
      <if test="examPaperId != null">
        #{examPaperId,jdbcType=INTEGER},
      </if>
      <if test="examPaperAnswerId != null">
        #{examPaperAnswerId,jdbcType=INTEGER},
      </if>
      <if test="questionType != null">
        #{questionType,jdbcType=INTEGER},
      </if>
      <if test="subjectId != null">
        #{subjectId,jdbcType=INTEGER},
      </if>
      <if test="customerScore != null">
        #{customerScore,jdbcType=INTEGER},
      </if>
      <if test="questionScore != null">
        #{questionScore,jdbcType=INTEGER},
      </if>
      <if test="questionTextContentId != null">
        #{questionTextContentId,jdbcType=INTEGER},
      </if>
      <if test="answer != null">
        #{answer,jdbcType=VARCHAR},
      </if>
      <if test="textContentId != null">
        #{textContentId,jdbcType=INTEGER},
      </if>
      <if test="doRight != null">
        #{doRight,jdbcType=BIT},
      </if>
      <if test="createUser != null">
        #{createUser,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="itemOrder != null">
        #{itemOrder,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer">
    update t_exam_paper_question_customer_answer
    <set>
      <if test="questionId != null">
        question_id = #{questionId,jdbcType=INTEGER},
      </if>
      <if test="examPaperId != null">
        exam_paper_id = #{examPaperId,jdbcType=INTEGER},
      </if>
      <if test="examPaperAnswerId != null">
        exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
      </if>
      <if test="questionType != null">
        question_type = #{questionType,jdbcType=INTEGER},
      </if>
      <if test="subjectId != null">
        subject_id = #{subjectId,jdbcType=INTEGER},
      </if>
      <if test="customerScore != null">
        customer_score = #{customerScore,jdbcType=INTEGER},
      </if>
      <if test="questionScore != null">
        question_score = #{questionScore,jdbcType=INTEGER},
      </if>
      <if test="questionTextContentId != null">
        question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
      </if>
      <if test="answer != null">
        answer = #{answer,jdbcType=VARCHAR},
      </if>
      <if test="textContentId != null">
        text_content_id = #{textContentId,jdbcType=INTEGER},
      </if>
      <if test="doRight != null">
        do_right = #{doRight,jdbcType=BIT},
      </if>
      <if test="createUser != null">
        create_user = #{createUser,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="itemOrder != null">
        item_order = #{itemOrder,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer">
    update t_exam_paper_question_customer_answer
    set question_id = #{questionId,jdbcType=INTEGER},
      exam_paper_id = #{examPaperId,jdbcType=INTEGER},
      exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
      question_type = #{questionType,jdbcType=INTEGER},
      subject_id = #{subjectId,jdbcType=INTEGER},
      customer_score = #{customerScore,jdbcType=INTEGER},
      question_score = #{questionScore,jdbcType=INTEGER},
      question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
      answer = #{answer,jdbcType=VARCHAR},
      text_content_id = #{textContentId,jdbcType=INTEGER},
      do_right = #{doRight,jdbcType=BIT},
      create_user = #{createUser,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      item_order = #{itemOrder,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectListByPaperAnswerId" resultMap="BaseResultMap">
@@ -228,7 +35,8 @@
  </select>
  <select id="studentPage" resultMap="BaseResultMap" parameterType="com.ycl.jxkg.vo.student.question.answer.QuestionPageStudentRequestVO">
    <select id="studentPage" resultMap="BaseResultMap"
            parameterType="com.ycl.jxkg.vo.student.question.answer.QuestionPageStudentRequestVO">
    SELECT
    <include refid="Base_Column_List"/>
    FROM t_exam_paper_question_customer_answer
@@ -237,7 +45,6 @@
      and create_user=#{createUser}
    </where>
  </select>
  <insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id" >
    insert into t_exam_paper_question_customer_answer ( question_id, question_score,
@@ -249,21 +56,26 @@
    <foreach collection="list" item="item" index="index"
             separator=",">
      ( #{item.questionId,jdbcType=INTEGER}, #{item.questionScore,jdbcType=INTEGER},
      #{item.subjectId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.createUser,jdbcType=INTEGER},
      #{item.textContentId,jdbcType=INTEGER}, #{item.examPaperId,jdbcType=INTEGER}, #{item.questionType,jdbcType=INTEGER},
      #{item.answer,jdbcType=VARCHAR}, #{item.customerScore,jdbcType=INTEGER}, #{item.examPaperAnswerId,jdbcType=INTEGER},
            #{item.subjectId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
            #{item.createUser,jdbcType=INTEGER},
            #{item.textContentId,jdbcType=INTEGER}, #{item.examPaperId,jdbcType=INTEGER},
            #{item.questionType,jdbcType=INTEGER},
            #{item.answer,jdbcType=VARCHAR}, #{item.customerScore,jdbcType=INTEGER},
            #{item.examPaperAnswerId,jdbcType=INTEGER},
      #{item.doRight,jdbcType=BIT},#{item.questionTextContentId,jdbcType=INTEGER},#{item.itemOrder,jdbcType=INTEGER})
    </foreach>
  </insert>
  <select id="selectAllCount"  resultType="java.lang.Integer">
      SELECT count(*) from t_exam_paper_question_customer_answer
        SELECT count(*)
        from t_exam_paper_question_customer_answer
  </select>
  <select id="selectCountByDate"  resultType="com.ycl.jxkg.domain.other.KeyValue">
      SELECT create_time as name,COUNT(create_time) as value from
        SELECT create_time as name, COUNT(create_time) as value
        from
              (
              SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_question_customer_answer
               WHERE  create_time  between  #{startTime}  and  #{endTime}