初始化dev
This commit is contained in:
30
target/classes/mapper/AIClientService.xml
Normal file
30
target/classes/mapper/AIClientService.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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.qingqiu.interview.mapper.InterviewSessionMapper">
|
||||
|
||||
<select id="selectBySessionId" resultType="com.qingqiu.interview.entity.InterviewSession">
|
||||
SELECT * FROM interview_session
|
||||
WHERE session_id = #{sessionId} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectActiveSessionsByModel" resultType="com.qingqiu.interview.entity.InterviewSession">
|
||||
SELECT * FROM interview_session
|
||||
WHERE ai_model = #{aiModel} AND status = 'ACTIVE' AND deleted = 0
|
||||
ORDER BY created_time DESC
|
||||
</select>
|
||||
|
||||
<update id="updateSessionStatus">
|
||||
UPDATE interview_session
|
||||
SET status = #{status}, updated_time = NOW()
|
||||
WHERE session_id = #{sessionId}
|
||||
</update>
|
||||
|
||||
<select id="countRecentInterviews" resultType="com.qingqiu.interview.dto.DashboardStatsResponse$DailyStat">
|
||||
SELECT DATE(created_time) as date, COUNT(*) as count
|
||||
FROM interview_session
|
||||
WHERE created_time >= DATE_SUB(NOW(), INTERVAL #{days} DAY)
|
||||
GROUP BY DATE(created_time)
|
||||
ORDER BY date ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
5
target/classes/mapper/AiSessionLogMapper.xml
Normal file
5
target/classes/mapper/AiSessionLogMapper.xml
Normal file
@@ -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.qingqiu.interview.mapper.AiSessionLogMapper">
|
||||
|
||||
</mapper>
|
||||
17
target/classes/mapper/InterviewEvaluationMapper.xml
Normal file
17
target/classes/mapper/InterviewEvaluationMapper.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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.qingqiu.interview.mapper.InterviewEvaluationMapper">
|
||||
|
||||
<select id="selectBySessionId" resultType="com.qingqiu.interview.entity.InterviewEvaluation">
|
||||
SELECT * FROM interview_evaluation
|
||||
WHERE session_id = #{sessionId}
|
||||
ORDER BY created_time ASC
|
||||
</select>
|
||||
|
||||
<select id="selectBySessionIdAndQuestionId" resultType="com.qingqiu.interview.entity.InterviewEvaluation">
|
||||
SELECT * FROM interview_evaluation
|
||||
WHERE session_id = #{sessionId} AND question_id = #{questionId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
23
target/classes/mapper/InterviewMessageMapper.xml
Normal file
23
target/classes/mapper/InterviewMessageMapper.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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.qingqiu.interview.mapper.InterviewMessageMapper">
|
||||
|
||||
<select id="selectBySessionIdOrderByOrder" resultType="com.qingqiu.interview.entity.InterviewMessage">
|
||||
SELECT * FROM interview_message
|
||||
WHERE session_id = #{sessionId}
|
||||
ORDER BY message_order ASC
|
||||
</select>
|
||||
|
||||
<select id="selectLatestBySessionId" resultType="com.qingqiu.interview.entity.InterviewMessage">
|
||||
SELECT * FROM interview_message
|
||||
WHERE session_id = #{sessionId}
|
||||
ORDER BY message_order DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectMaxOrderBySessionId" resultType="int">
|
||||
SELECT COALESCE(MAX(message_order), 0) FROM interview_message
|
||||
WHERE session_id = #{sessionId}
|
||||
</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.qingqiu.interview.mapper.InterviewQuestionProgressMapper">
|
||||
|
||||
</mapper>
|
||||
50
target/classes/mapper/QuestionMapper.xml
Normal file
50
target/classes/mapper/QuestionMapper.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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.qingqiu.interview.mapper.QuestionMapper">
|
||||
|
||||
<select id="selectByCategory" resultType="com.qingqiu.interview.entity.Question">
|
||||
SELECT *
|
||||
FROM question
|
||||
WHERE category = #{category} AND deleted = 0
|
||||
ORDER BY created_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectByCategories" resultType="com.qingqiu.interview.entity.Question">
|
||||
SELECT *
|
||||
FROM question
|
||||
WHERE category IN
|
||||
<foreach collection="categories" item="category" open="(" separator="," close=")">
|
||||
#{category}
|
||||
</foreach>
|
||||
AND deleted = 0
|
||||
ORDER BY created_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectRandomByCategories" resultType="com.qingqiu.interview.entity.Question">
|
||||
SELECT *
|
||||
FROM question
|
||||
WHERE category IN
|
||||
<foreach collection="categories" item="category" open="(" separator="," close=")">
|
||||
#{category}
|
||||
</foreach>
|
||||
AND deleted = 0
|
||||
ORDER BY RAND()
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectByContent" resultType="com.qingqiu.interview.entity.Question">
|
||||
SELECT *
|
||||
FROM question
|
||||
WHERE content = #{content} AND deleted = 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="countByCategory" resultType="com.qingqiu.interview.dto.DashboardStatsResponse$CategoryStat">
|
||||
SELECT category as name, COUNT(*) as value
|
||||
FROM question
|
||||
WHERE deleted = 0
|
||||
GROUP BY category
|
||||
ORDER BY value DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user