|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.blockchain.server.yyyf.mapper.AssessUserMapper">
|
|
|
|
<resultMap id="AssessUserDtoMap" type="com.blockchain.server.yyyf.dto.AssessUserDto">
|
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
|
<result column="train_id" jdbcType="VARCHAR" property="trainId" />
|
|
|
|
<result column="issue_id" jdbcType="VARCHAR" property="issueId" />
|
|
|
|
<result column="ss_practise_id" jdbcType="VARCHAR" property="ssPractiseId" />
|
|
|
|
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
|
|
|
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
|
|
|
<result column="user_type" jdbcType="INTEGER" property="userType" />
|
|
|
|
<result column="total_score" jdbcType="DECIMAL" property="totalScore" />
|
|
|
|
<result column="duration" jdbcType="INTEGER" property="duration" />
|
|
|
|
<result column="duration_unit" jdbcType="VARCHAR" property="durationUnit" />
|
|
|
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
|
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
|
|
|
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
|
|
|
|
<result column="achieve_ment_type" jdbcType="INTEGER" property="achieveMentType" />
|
|
|
|
<result column="class_id" jdbcType="VARCHAR" property="classId" />
|
|
|
|
<result column="course_id" jdbcType="VARCHAR" property="courseId" />
|
|
|
|
|
|
|
|
<collection property="assessUserTargetList" column="assess_user_id" ofType="com.blockchain.server.yyyf.entity.AssessUserTarget" javaType="ArrayList">
|
|
|
|
<result column="assessUser_target_id" jdbcType="VARCHAR" property="id" />
|
|
|
|
<result column="assess_user_id" jdbcType="VARCHAR" property="assessUserId" />
|
|
|
|
<result column="target_name" jdbcType="VARCHAR" property="targetName" />
|
|
|
|
<result column="target_id" jdbcType="VARCHAR" property="targetId" />
|
|
|
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
|
|
|
<result column="task_operate" jdbcType="TINYINT" property="taskOperate" />
|
|
|
|
<result column="task_rate" jdbcType="DECIMAL" property="taskRate" />
|
|
|
|
<result column="task_score" jdbcType="DECIMAL" property="taskScore" />
|
|
|
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
|
|
|
<result column="student_rate" jdbcType="DECIMAL" property="studentRate" />
|
|
|
|
<result column="answer" jdbcType="INTEGER" property="answer" />
|
|
|
|
</collection>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="UserTimeMoneyDtoMap" type="com.blockchain.server.yyyf.dto.UserTimeMoneyDto">
|
|
|
|
<id column="id" jdbcType="VARCHAR" property="assessUserId" />
|
|
|
|
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
|
|
|
<result column="q_user_id" jdbcType="VARCHAR" property="qUserId" />
|
|
|
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
|
|
<result column="wx_pay" jdbcType="DECIMAL" property="wxPay" />
|
|
|
|
<result column="ali_pay" jdbcType="DECIMAL" property="aliPay" />
|
|
|
|
<result column="bank_card" jdbcType="DECIMAL" property="bankCard" />
|
|
|
|
<result column="btc" jdbcType="DECIMAL" property="btc" />
|
|
|
|
<result column="usdt" jdbcType="DECIMAL" property="usdt" />
|
|
|
|
<result column="eth" jdbcType="DECIMAL" property="eth" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="batchUpdateTotalScoreByAssessUserDtoList" parameterType="list">
|
|
|
|
<foreach collection="assessUserDtoList" item="item" separator=";" close=";">
|
|
|
|
update yyyf_server_assess_user
|
|
|
|
set total_score = #{item.totalScore,jdbcType=DECIMAL}, duration = #{item.duration,jdbcType=INTEGER},end_time = #{item.endTime,jdbcType=TIMESTAMP}
|
|
|
|
where id = #{item.id,jdbcType=VARCHAR}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectUserGradeCase" resultType="java.util.Map" >
|
|
|
|
select AVG(t.TOTAL_SCORE) as avg,
|
|
|
|
MAX(t.TOTAL_SCORE) as max,
|
|
|
|
MIN(t.TOTAL_SCORE) as min
|
|
|
|
from yyyf_server_assess_user t
|
|
|
|
where t.class_id= #{classId} and t.issue_id= #{issueId}
|
|
|
|
</select>
|
|
|
|
<select id="selectUserGradeListByClassIdAndIssueId" resultType="java.util.Map">
|
|
|
|
SELECT t.user_id as userAId,t.TOTAL_SCORE AS totalScore from yyyf_server_assess_user t
|
|
|
|
where t.issue_id= #{issueId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectAssessUserDtoByIssueId" resultMap="AssessUserDtoMap">
|
|
|
|
SELECT
|
|
|
|
u.id,
|
|
|
|
u.train_id,
|
|
|
|
u.issue_id,
|
|
|
|
u.ss_practise_id,
|
|
|
|
u.user_id,
|
|
|
|
u.user_name,
|
|
|
|
u.user_type,
|
|
|
|
u.total_score,
|
|
|
|
u.duration,
|
|
|
|
u.duration_unit,
|
|
|
|
u.start_time,
|
|
|
|
u.end_time,
|
|
|
|
u.case_id,
|
|
|
|
u.achieve_ment_type,
|
|
|
|
u.class_id,
|
|
|
|
u.course_id,
|
|
|
|
t.id as assessUser_target_id,
|
|
|
|
t.assess_user_id,
|
|
|
|
t.target_name,
|
|
|
|
t.target_id,
|
|
|
|
t. code,
|
|
|
|
t.task_operate,
|
|
|
|
t.task_rate,
|
|
|
|
t.task_score,
|
|
|
|
t.sort,
|
|
|
|
t.student_rate,
|
|
|
|
t.answer
|
|
|
|
FROM
|
|
|
|
yyyf_server_assess_user u,
|
|
|
|
yyyf_server_assess_user_target t
|
|
|
|
WHERE
|
|
|
|
u.id = t.assess_user_id and u.issue_id=#{issueId}
|
|
|
|
</select>
|
|
|
|
<select id="selectUserTimeMoneyDtosForNotEnd" resultMap="UserTimeMoneyDtoMap">
|
|
|
|
SELECT au.id ,m.wx_pay,m.ali_pay,m.bank_card,m.btc,m.eth,m.usdt from yyyf_server_assess_user au,yyyf_money m
|
|
|
|
where au.id=m.assess_user_id and au.end_time is null
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|