parent
3d24b751b6
commit
39509d1f25
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@ |
||||
<?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.wrj.driver.server.mapper.WrjChapterMapper"> |
||||
<select id="queryChapter" resultType="com.wrj.driver.server.vo.ChapterVo"> |
||||
select |
||||
a.chapter_id, |
||||
a.chapter_name, |
||||
a.sort, |
||||
a.summary |
||||
from wrj_chapter a |
||||
join wrj_type_chapter b on a.chapter_id = b.chapter_id |
||||
<where> |
||||
a.is_active = 0 |
||||
<if test="param.driverTypeId != null"> and b.type_id = #{param.driverTypeId} </if> |
||||
<if test="param.chapterId != null"> and a.chapter_id = #{param.chapterId} </if> |
||||
</where> |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,5 @@ |
||||
<?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.wrj.driver.server.mapper.WrjDriverTypeMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,200 @@ |
||||
<?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.wrj.driver.server.mapper.WrjQuestionMapper"> |
||||
|
||||
<select id="queryQuestion" resultType="com.wrj.driver.server.vo.QuestionVo"> |
||||
select |
||||
tq.question_id, |
||||
tq.question, |
||||
tq.choose_a, |
||||
tq.choose_b, |
||||
tq.choose_c, |
||||
tq.choose_d, |
||||
tq.choose_e, |
||||
tq.choose_f, |
||||
tq.choose_g, |
||||
tq.true_answer, |
||||
tq.image_url, |
||||
tq.best_answer, |
||||
tq.skill_info, |
||||
tq.error_info, |
||||
tq.chapter, |
||||
tq.options, |
||||
tq.type, |
||||
tq.show_order, |
||||
tq.origin_id, |
||||
tq.is_active, |
||||
tq.title_words, |
||||
tq.skill_words, |
||||
tq.a_words, |
||||
tq.b_words, |
||||
tq.c_words, |
||||
tq.d_words |
||||
from wrj_question tq |
||||
left join wrj_chapter cha on tq.chapter = cha.chapter_id |
||||
left join wrj_type_chapter tcc on tcc.chapter_id = cha.chapter_id |
||||
<where> |
||||
tq.is_active = '0' |
||||
<if test="queryDto.questionId !=null"> |
||||
and tq.question_id = #{queryDto.questionId} |
||||
</if> |
||||
<if test="queryDto.questionIdList !=null and queryDto.questionIdList.size() > 0"> |
||||
and tq.question_id in |
||||
<foreach collection="queryDto.questionIdList" open="(" item="item" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
</if> |
||||
<if test="queryDto.chapter !=null"> |
||||
and tq.chapter = #{queryDto.chapter} |
||||
</if> |
||||
<if test="queryDto.question !=null and queryDto.question !=''"> |
||||
and tq.question like concat('%' , #{queryDto.question} , '%') |
||||
</if> |
||||
<if test="queryDto.driverTypeId !=null"> |
||||
and tcc.type_id = #{queryDto.driverTypeId} |
||||
</if> |
||||
<if test="queryDto.type !=null and queryDto.type != ''"> |
||||
and tq.type = #{queryDto.type} |
||||
</if> |
||||
<if test="queryDto.isImage !=null"> |
||||
and tq.image_url is not null |
||||
</if> |
||||
</where> |
||||
group by tq.question_id |
||||
order by tq.show_order asc, question_id asc |
||||
</select> |
||||
|
||||
<select id="queryQuestionByRandom" resultType="com.wrj.driver.server.vo.QuestionVo"> |
||||
select |
||||
tq.question_id, |
||||
tq.question, |
||||
tq.choose_a, |
||||
tq.choose_b, |
||||
tq.choose_c, |
||||
tq.choose_d, |
||||
tq.choose_e, |
||||
tq.choose_f, |
||||
tq.choose_g, |
||||
tq.true_answer, |
||||
tq.image_url, |
||||
tq.best_answer, |
||||
tq.skill_info, |
||||
tq.error_info, |
||||
tq.chapter, |
||||
tq.options, |
||||
tq.type, |
||||
tq.show_order, |
||||
tq.origin_id, |
||||
tq.is_active, |
||||
tq.title_words, |
||||
tq.skill_words, |
||||
tq.a_words, |
||||
tq.b_words, |
||||
tq.c_words, |
||||
tq.d_words |
||||
from wrj_question tq |
||||
left join wrj_type_chapter tcc on tcc.chapter_id = tq.chapter |
||||
<where> |
||||
tq.is_active = '0' |
||||
<if test="queryDto.driverTypeId !=null"> |
||||
and tcc.type_id = #{queryDto.driverTypeId} |
||||
</if> |
||||
<if test="queryDto.type !=null and queryDto.type != ''"> |
||||
and tq.TYPE = #{queryDto.type} |
||||
</if> |
||||
<if test="queryDto.chapter !=null"> |
||||
and tq.chapter = #{queryDto.chapter} |
||||
</if> |
||||
</where> |
||||
order by rand() limit ${queryDto.num}; |
||||
</select> |
||||
|
||||
<update id="updateQuestion" parameterType="com.wrj.driver.server.vo.QuestionVo"> |
||||
update wrj_question |
||||
<trim prefix="SET" suffixOverrides=","> |
||||
<if test="questionVo.skillInfo !=null and questionVo.skillInfo !=''"> |
||||
skill_info = #{questionVo.skillInfo}, |
||||
</if> |
||||
<if test="questionVo.imageUrl !=null"> |
||||
image_url = #{questionVo.imageUrl}, |
||||
</if> |
||||
</trim> |
||||
where question_id = #{questionVo.questionId} |
||||
</update> |
||||
|
||||
<select id="querySpecialNum" resultType="java.util.Map"> |
||||
select |
||||
count(IF(TYPE = '1', tq.type, NULL)) as judgeQuestionNum, |
||||
count(IF(TYPE = '2', tq.type, NULL)) as radioQuestionNum, |
||||
count(IF(TYPE = '3', tq.type, NULL)) as multipleChoiceQuestionNum, |
||||
count(IFNULL(tq.image_url, NULL)) as imageQuestionNum |
||||
from wrj_question tq |
||||
left join wrj_type_chapter tcc on tcc.chapter_id = tq.chapter |
||||
where tcc.type_id = #{queryDto.driverTypeId} |
||||
and tq.is_active = '0' |
||||
</select> |
||||
|
||||
<select id="queryQuestionId" resultType="java.lang.Long"> |
||||
select |
||||
tq.question_id |
||||
from wrj_question tq |
||||
left join wrj_type_chapter tcc on tcc.chapter_id = tq.chapter |
||||
<where> |
||||
tq.is_active = '0' |
||||
<if test="queryDto.questionId !=null"> |
||||
and tq.question_id = #{queryDto.questionId} |
||||
</if> |
||||
<if test="queryDto.questionIdList !=null and queryDto.questionIdList.size() > 0"> |
||||
and tq.question_id in |
||||
<foreach collection="queryDto.questionIdList" open="(" item="item" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
</if> |
||||
<if test="queryDto.chapter !=null"> |
||||
and tq.chapter = #{queryDto.chapter} |
||||
</if> |
||||
<if test="queryDto.question !=null and queryDto.question !=''"> |
||||
and tq.question like concat('%' , #{queryDto.question} , '%') |
||||
</if> |
||||
<if test="queryDto.driverTypeId !=null"> |
||||
and tcc.type_id = #{queryDto.driverTypeId} |
||||
</if> |
||||
<if test="queryDto.type !=null and queryDto.type != ''"> |
||||
and tq.type = #{queryDto.type} |
||||
</if> |
||||
<if test="queryDto.isImage !=null"> |
||||
and tq.image_url is not null |
||||
</if> |
||||
</where> |
||||
group by tq.question_id |
||||
order by tq.show_order asc |
||||
</select> |
||||
|
||||
<select id="queryQuestionIdByRandom" resultType="java.lang.Long"> |
||||
select |
||||
tq.question_id |
||||
from wrj_question tq |
||||
left join wrj_type_chapter tcc on tcc.chapter_id = tq.chapter |
||||
|
||||
<where> |
||||
tq.is_active = '0' |
||||
<if test="queryDto.driverTypeId !=null"> |
||||
and tcc.type_id = #{queryDto.driverTypeId} |
||||
</if> |
||||
<if test="queryDto.type !=null and queryDto.type != ''"> |
||||
and tq.type = #{queryDto.type} |
||||
</if> |
||||
<if test="queryDto.chapter !=null"> |
||||
and tq.chapter = #{queryDto.chapter} |
||||
</if> |
||||
</where> |
||||
order by rand() limit ${queryDto.num}; |
||||
</select> |
||||
|
||||
<select id="queryMaxSort" resultType="java.lang.Integer"> |
||||
select |
||||
MAX(tq.show_order) |
||||
from wrj_question tq |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,29 @@ |
||||
<?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.wrj.driver.server.mapper.WrjQuestionTestMapper"> |
||||
|
||||
<select id="getTestScore" resultType="com.wrj.driver.server.vo.TestScoreVO"> |
||||
select |
||||
a.test_id, |
||||
a.model_id, |
||||
a.type_id as driverTypeId, |
||||
a.user_id, |
||||
a.score, |
||||
a.test_time, |
||||
a.create_time, |
||||
b.type_name as driverTypeName |
||||
from wrj_question_test a |
||||
inner join wrj_driver_type b on b.type_id = a.type_id |
||||
<where> |
||||
<if test="param.driverTypeId != null"> |
||||
and a.type_id = #{param.driverTypeId} |
||||
</if> |
||||
<if test="param.userId != null"> |
||||
and a.user_id = #{param.userId} |
||||
</if> |
||||
</where> |
||||
|
||||
order by a.create_time desc |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,5 @@ |
||||
<?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.wrj.driver.server.mapper.WrjSysConfigListMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,19 @@ |
||||
<?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.wrj.driver.server.mapper.WrjSysConfigMapper"> |
||||
|
||||
<update id="updateConfig"> |
||||
update wrj_sys_config |
||||
|
||||
<set> |
||||
<if test="param.configValue != null"> CONFIG_VALUE = #{param.configValue},</if> |
||||
<if test="param.configName != null"> CONFIG_NAME = #{param.configName},</if> |
||||
<if test="param.configDesc != null"> CONFIG_DESC = #{param.configDesc},</if> |
||||
<if test="param.configType != null"> CONFIG_TYPE = #{param.configType},</if> |
||||
<if test="param.configJson != null"> CONFIG_JSON = #{param.configJson},</if> |
||||
<if test="param.isActive != null"> IS_ACTIVE = #{param.isActive},</if> |
||||
</set> |
||||
where DRIVER_TYPE_ID = #{param.driverTypeId} and CONFIG_KEY = #{param.configKey} |
||||
</update> |
||||
|
||||
</mapper> |
@ -0,0 +1,18 @@ |
||||
<?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.wrj.driver.server.mapper.WrjTypeChapterMapper"> |
||||
<select id="queryWrjTypeChapter" resultType="com.wrj.driver.server.vo.WrjTypeChapterVo"> |
||||
select |
||||
id, |
||||
model_id, |
||||
type_id, |
||||
chapter_id, |
||||
judge_num, |
||||
radio_num, |
||||
multiple_choice_num, |
||||
from wrj_type_chapter |
||||
<where> |
||||
<if test="param.driverTypeId != null"> and type_id = #{param.driverTypeId} </if> |
||||
</where> |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue