Examination_system/Examination_system-1/.svn/pristine/50/50a4f3f65b619f0dda98a022ea5...

43 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-10-30 13:10:40 +08:00
<?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.bonus.weixin.dao.SelfTestDao">
<resultMap type="com.bonus.weixin.beans.SelfTestBean" id="SelfTestBean"></resultMap>
<select id="getSelfTest" parameterType="com.bonus.weixin.beans.SelfTestBean"
resultType="com.bonus.weixin.beans.SelfTestBean">
SELECT
sz.question_id AS questionId,
sz.content,
sz.operation,
sz.answer,
sz.question_type as questionType ,
sz.classification
FROM
sz_question sz
WHERE
sz.classification = #{questionId} and sz.question_type = #{questionType} ORDER BY RAND() LIMIT 10
</select>
<select id="getAnalysis" parameterType="com.bonus.weixin.beans.SelfTestBean"
resultType="com.bonus.weixin.beans.SelfTestBean">
SELECT
sz.question_id AS questionId,
sz.content,
sz.operation,
sz.answer,
sz.classification,
sz.case_id AS caseId,
sc.material
FROM sz_question sz
RIGHT JOIN sz_case sc on sz.case_id = sc.case_id
WHERE sz.classification = #{questionId}
</select>
<select id="findLoginName" parameterType="com.bonus.weixin.beans.SelfTestBean" resultMap="SelfTestBean">
select ORG_ID as orgId, LOGIN_NAME as username from pm_user WHERE LOGIN_NAME = #{username}
</select>
</mapper>