修改提出的问题和新需求

This commit is contained in:
2025-07-31 10:35:51 +08:00
parent ecd499a497
commit 9b6f200292
12 changed files with 275 additions and 21 deletions

View File

@ -62,14 +62,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectCjStudentByIds" parameterType="map" resultMap="CjStudentResult">
<select id="selectCjStudentByIds" resultMap="CjStudentResult">
<include refid="selectCjStudentVo"/>
<if test="ids != null and ids.length > 0">
WHERE id IN
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<where>
<if test="ids != null and ids.length > 0">
id IN
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="zy != null"> and xy = #{zy}</if>
</where>
</select>
<select id="selectCjStudentByXh" resultMap="CjStudentResult">
<include refid="selectCjStudentVo"/>
<where>
<if test="xh != null"> and xh = #{xh}</if>
</where>
limit 1
</select>
<select id="selectRyStudentList" resultMap="CjStudentResult">

View File

@ -47,13 +47,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertDwAnswerBatch" parameterType="list">
insert into dw_answer
(info_id, question_id, answer)
(info_id, question_id, answer,create_time)
VALUES
<foreach item="item" collection="list" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
#{item.infoId},
#{item.questionId},
#{item.answer}
#{item.answer},
SYSDATE()
</trim>
</foreach>
</insert>

View File

@ -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.ruoyi.dw.mapper.XyCheckMapper">
<resultMap type="XyCheckDw" id="xyCheckDw">
<result property="xy" column="xy" />
<result property="dwCount" column="dw_count" />
</resultMap>
<select id="selectXyCheckDw" resultMap="xyCheckDw">
SELECT
re.xy,re.order_index,
sum( re.dw_count ) as dw_count
FROM
(
SELECT
xy,order_index,
IFNULL( dw.dw_count, 0 ) AS dw_count
FROM
xy_zy xz
LEFT JOIN ( SELECT answer, count( 0 ) AS dw_count FROM dw_answer WHERE question_id IN ( 3, 43, 71 ) GROUP BY answer ) AS dw ON dw.answer = xz.zy
) AS re
GROUP BY re.xy,re.order_index
order by re.order_index
</select>
</mapper>