修改提出的问题和新需求
This commit is contained in:
@ -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">
|
||||
|
@ -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>
|
||||
|
29
ruoyi-dw/src/main/resources/mapper/dw/XyCheckMapper.xml
Normal file
29
ruoyi-dw/src/main/resources/mapper/dw/XyCheckMapper.xml
Normal 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>
|
Reference in New Issue
Block a user