初始化

This commit is contained in:
2025-07-28 15:14:11 +08:00
commit 896aea2b62
2037 changed files with 244374 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
<?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.srs.diagnostic.mapper.DiaEligibilityMapper">
<resultMap type="DiaEligibility" id="DiaEligibilityResult">
<result property="eliId" column="eliId" />
<result property="relId" column="relId" />
<result property="stuYearName" column="stu_year_name" />
<result property="status" column="status" />
<result property="name" column="name" />
</resultMap>
<sql id="selectDiaEligibilityVo">
select eliId,relId,stu_year_name,`status` from dia_eligibility;
</sql>
<select id="selectDiaEligibilityList" parameterType="DiaEligibility" resultMap="DiaEligibilityResult">
<include refid="selectDiaEligibilityVo"/>
<where>
<if test="relId != null "> and a.relId = #{relId}</if>
<if test="name != null and a.name!='' "> and name = #{name}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectDiaEligibilityByEliId" parameterType="Long" resultMap="DiaEligibilityResult">
<include refid="selectDiaEligibilityVo"/>
where eliId = #{eliId}
</select>
<insert id="insertDiaEligibility" parameterType="DiaEligibility">
insert into dia_eligibility
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eliId != null">eliId,</if>
<if test="relId != null">relId,</if>
<if test="stuYearName != null">stu_year_name,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eliId != null">#{eliId},</if>
<if test="relId != null">#{relId},</if>
<if test="stuYearName != null">#{stuYearName},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateDiaEligibility" parameterType="DiaEligibility">
update dia_eligibility
<trim prefix="SET" suffixOverrides=",">
<if test="relId != null">relId = #{relId},</if>
<if test="stuYearName != null">stu_year_name = #{stuYearName},</if>
<if test="status != null">status = #{status},</if>
</trim>
where eliId = #{eliId}
</update>
<delete id="deleteDiaEligibilityByEliId" parameterType="Long">
delete from dia_eligibility where eliId = #{eliId}
</delete>
<delete id="deleteDiaEligibilityByEliIds" parameterType="String">
delete from dia_eligibility where eliId in
<foreach item="eliId" collection="array" open="(" separator="," close=")">
#{eliId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,99 @@
<?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.srs.diagnostic.mapper.DiaFillOutReportMapper">
<resultMap type="DiaFillOutReport" id="DiaFillOutReportResult">
<result property="id" column="id"/>
<result property="completionStatus" column="completion_status"/>
<result property="reasonForIncompletion" column="reason_for_incompletion"/>
<result property="improvementActions" column="improvement_actions"/>
<result property="userId" column="user_id"/>
</resultMap>
<sql id="selectDiaFillOutReportVo">
SELECT id, reason_for_incompletion, improvement_actions,user_id
FROM dia_report_submissions
</sql>
<select id="selectDiaFillOutReportList" parameterType="DiaFillOutReport" resultMap="DiaFillOutReportResult">
SELECT
d.*,
s.completion_status,
s.reason_for_incompletion,
s.improvement_actions,
dept.dept_name
FROM
dia_report_details d
LEFT JOIN dia_report_submissions s
ON d.id = s.id
LEFT JOIN sys_dept dept
ON d.college_id = dept.dept_id
WHERE
d.user_id = #{userId};
</select>
<select id="selectDiaFillOutReportListUser" parameterType="String" resultMap="DiaFillOutReportResult">
SELECT
d.*,
s.completion_status,
s.reason_for_incompletion,
s.improvement_actions,
dept.dept_name
FROM
dia_report_details d
LEFT JOIN dia_report_submissions s
ON d.id = s.id
LEFT JOIN sys_dept dept
ON d.college_id = dept.dept_id
WHERE
d.stu_no = #{stuNo};
</select>
<insert id="insertDiaFillOutReport" parameterType="DiaFillOutReport" useGeneratedKeys="true" keyProperty="id">
INSERT INTO dia_report_submissions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="completionStatus != null">completion_status,</if>
<if test="reasonForIncompletion != null">reason_for_incompletion,</if>
<if test="improvementActions != null">improvement_actions,</if>
created_at,
updated_at
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="completionStatus != null">#{completionStatus},</if>
<if test="reasonForIncompletion != null">#{reasonForIncompletion},</if>
<if test="improvementActions != null">#{improvementActions},</if>
NOW(),
NOW()
</trim>
</insert>
<insert id="insertDiaFillOutReportList" parameterType="java.util.List">
INSERT INTO dia_report_submissions
( completion_status, reason_for_incompletion, improvement_actions, updated_at,user_id)
VALUES
<foreach collection="list" item="item" separator=",">
( #{item.completionStatus}, #{item.reasonForIncompletion}, #{item.improvementActions}, NOW(), #{item.userId})
</foreach>
</insert>
<update id="updateDiaFillOutReportList" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";">
UPDATE dia_report_submissions s
LEFT JOIN dia_report_details d ON s.id = d.id
<set>
<if test="item.completionStatus != null">s.completion_status = #{item.completionStatus},</if>
<if test="item.reasonForIncompletion != null">s.reason_for_incompletion = #{item.reasonForIncompletion},</if>
<if test="item.improvementActions != null">s.improvement_actions = #{item.improvementActions},</if>
s.updated_at = NOW()
</set>
WHERE
d.user_id = #{item.userId}
AND s.id = #{item.id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,351 @@
<?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.srs.diagnostic.mapper.DiaReportDetailsMapper">
<resultMap type="DiaReportDetails" id="DiaReportDetailsResult">
<result property="id" column="id"/>
<result property="relId" column="relId"/>
<result property="reportName" column="reportName"/>
<result property="userId" column="user_id"/>
<result property="stuNo" column="stu_no"/>
<result property="studentName" column="student_name"/>
<result property="submitterType" column="submitter_type"/>
<result property="collegeId" column="college_id"/>
<result property="collegeName" column="college_name"/>
<result property="status" column="status"/>
<result property="operatorId" column="operator_id"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
<result property="reportId" column="report_id"/>
<result property="dimensionId" column="dimension_id"/>
<result property="dimensionName" column="dimension_name"/>
<result property="qualityControlPointId" column="quality_control_point_id"/>
<result property="qualityControlPointName" column="quality_control_point_name"/>
<result property="indicatorId" column="indicator_id"/>
<result property="indicatorName" column="indicator_name"/>
<result property="schoolQualifiedStandard" column="school_qualified_standard"/>
<result property="secondaryCollegeStandard" column="secondary_college_standard"/>
<result property="personalTargetStandard" column="personal_target_standard"/>
<result property="detailsStatus" column="details_status"/>
</resultMap>
<sql id="selectDiaReportDetailsVo">
SELECT id, relId, reportName, user_id, stu_no, student_name, submitter_type, college_id, college_name,
status, operator_id, created_at, updated_at, report_id, dimension_id, dimension_name,
quality_control_point_id, quality_control_point_name, indicator_id, indicator_name,
school_qualified_standard, secondary_college_standard, personal_target_standard, details_status
FROM dia_report_details d
</sql>
<select id="selectDiaReportDetailsList" parameterType="DiaReportDetails" resultMap="DiaReportDetailsResult">
SELECT
d.id,
d.relId,
d.reportName,
d.user_id,
d.stu_no,
u.nick_name AS student_name,
d.submitter_type,
d.college_id,
p.dept_name AS college_name,
d.status,
d.operator_id,
d.created_at,
d.updated_at,
d.report_id,
d.dimension_id,
d.dimension_name,
d.quality_control_point_id,
d.quality_control_point_name,
d.indicator_id,
d.indicator_name,
d.school_qualified_standard,
d.secondary_college_standard,
d.personal_target_standard,
d.details_status
FROM dia_report_details d
LEFT JOIN sys_user u ON d.user_id = u.user_id
LEFT JOIN sys_dept p ON d.college_id = p.dept_id
<where>
<!-- 层级查询条件 -->
<if test="params.reportId != null">
AND d.report_id = #{params.reportId}
</if>
<if test="params.dimensionId != null">
AND d.dimension_id = #{params.dimensionId}
</if>
<if test="params.qualityControlPointId != null">
AND d.quality_control_point_id = #{params.qualityControlPointId}
</if>
<if test="indicatorId != null">
AND d.indicator_id = #{params.indicatorId}
</if>
<!-- 根据用户ID查询 -->
<if test="userId != null">
AND d.user_id = #{userId}
</if>
<!-- 层级关系查询 -->
<if test="params.needHierarchy != null and params.needHierarchy == true">
AND EXISTS (
SELECT 1 FROM dia_reports r1
LEFT JOIN dia_reports r2 ON r2.parentId = r1.reportId
LEFT JOIN dia_reports r3 ON r3.parentId = r2.reportId
LEFT JOIN dia_reports r4 ON r4.parentId = r3.reportId
WHERE r1.parentId = 0
AND (
d.report_id = r1.reportId
OR d.dimension_id = r2.reportId
OR d.quality_control_point_id = r3.reportId
OR d.indicator_id = r4.reportId
)
<if test="params.topReportName != null and params.topReportName != ''">
AND r1.name LIKE concat('%', #{params.topReportName}, '%')
</if>
)
</if>
</where>
ORDER BY d.report_id, d.dimension_id, d.quality_control_point_id, d.indicator_id
</select>
<!--查询后进行修改名字-->
<update id="updateStudentNameFromNickName" parameterType="com.srs.diagnostic.domain.DiaReportDetails">
UPDATE dia_report_details d
LEFT JOIN sys_user u ON d.user_id = u.user_id
LEFT JOIN sys_dept p ON d.college_id = p.dept_id
SET
d.student_name = u.nick_name,
d.college_name = p.dept_name
WHERE
d.student_name IS NULL
<if test="userId != null">
AND u.user_id = #{userId}
</if>
</update>
<!-- 新增的批量插入方法,基于层级关系 -->
<insert id="batchInsertReportDetailsByHierarchy" parameterType="java.util.List">
INSERT INTO dia_report_details (
relId, report_id, dimension_id, dimension_name,
quality_control_point_id, quality_control_point_name,
indicator_id, indicator_name, reportName,
user_id, stu_no, student_name, submitter_type,
college_id, college_name, status, operator_id,
created_at, updated_at, details_status
)
SELECT
#{list[0].userId} AS relId,
r1.reportId AS report_id,
r2.reportId AS dimension_id,
r2.name AS dimension_name,
r3.reportId AS quality_control_point_id,
r3.name AS quality_control_point_name,
r4.reportId AS indicator_id,
r4.name AS indicator_name,
r1.name AS reportName,
#{list[0].userId} AS user_id,
#{list[0].stuNo} AS stu_no,
#{list[0].studentName} AS student_name,
#{list[0].submitterType} AS submitter_type,
#{list[0].collegeId} AS college_id,
#{list[0].collegeName} AS college_name,
'0' AS status,
#{list[0].operatorId} AS operator_id,
NOW() AS created_at,
NOW() AS updated_at,
'0' AS details_status
FROM
dia_reports r1
LEFT JOIN dia_reports r2 ON r2.parentId = r1.reportId
LEFT JOIN dia_reports r3 ON r3.parentId = r2.reportId
LEFT JOIN dia_reports r4 ON r4.parentId = r3.reportId
WHERE
r1.parentId = 0
AND r2.reportId IS NOT NULL
ON DUPLICATE KEY UPDATE
updated_at = VALUES(updated_at),
status = VALUES(status);
</insert>
<insert id="insertDiaStudentInfo" parameterType="DiaReportDetails" useGeneratedKeys="true" keyProperty="id">
insert into dia_student_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stuNo != null and studentNumber != ''">stu_no,</if>
<if test="collegeId != null">college_id,</if>
<if test="collegeName != null and collegeName != ''">college_name,</if>
<if test="majorId != null">major_id,</if>
<if test="majorName != null and majorName != ''">major_name,</if>
<if test="userId != null">user_id,</if>
<if test="studentName != null and studentName != ''">student_name,</if>
<if test="semesterId != null">semester_id,</if>
<if test="semesterName != null and semesterName != ''">semester_name,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stuNo != null and studentNumber != ''">#{stuNo},</if>
<if test="collegeId != null">#{collegeId},</if>
<if test="collegeName != null and collegeName != ''">#{collegeName},</if>
<if test="majorId != null">#{deptId},</if>
<if test="majorName != null and majorName != ''">#{deptName},</if>
<if test="userId != null">#{userId},</if>
<if test="studentName != null and studentName != ''">#{studentName},</if>
<if test="semesterId != null">#{semesterId},</if>
<if test="semesterName != null and semesterName != ''">#{semesterName},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<select id="selectDiaReportDetailsById" parameterType="Long" resultMap="DiaReportDetailsResult">
<include refid="selectDiaReportDetailsVo"/>
WHERE id = #{id}
</select>
<insert id="insertDiaReportDetails" parameterType="DiaReportDetails" useGeneratedKeys="true" keyProperty="id">
INSERT INTO dia_report_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="relId != null">relId,</if>
<if test="reportName != null">reportName,</if>
<if test="userId != null">user_id,</if>
<if test="stuNo != null">stu_no,</if>
<if test="studentName != null">student_name,</if>
<if test="submitterType != null">submitter_type,</if>
<if test="collegeId != null">college_id,</if>
<if test="collegeName != null">college_name,</if>
<if test="status != null">status,</if>
<if test="operatorId != null">operator_id,</if>
<if test="reportId != null">report_id,</if>
<if test="dimensionId != null">dimension_id,</if>
<if test="dimensionName != null">dimension_name,</if>
<if test="qualityControlPointId != null">quality_control_point_id,</if>
<if test="qualityControlPointName != null">quality_control_point_name,</if>
<if test="indicatorId != null">indicator_id,</if>
<if test="indicatorName != null">indicator_name,</if>
<if test="schoolQualifiedStandard != null">school_qualified_standard,</if>
<if test="secondaryCollegeStandard != null">secondary_college_standard,</if>
<if test="personalTargetStandard != null">personal_target_standard,</if>
<if test="detailsStatus != null">details_status,</if>
created_at,
updated_at
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="relId != null">#{relId},</if>
<if test="reportName != null">#{reportName},</if>
<if test="userId != null">#{userId},</if>
<if test="stuNo != null">#{stuNo},</if>
<if test="studentName != null">#{studentName},</if>
<if test="submitterType != null">#{submitterType},</if>
<if test="collegeId != null">#{collegeId},</if>
<if test="collegeName != null">#{collegeName},</if>
<if test="status != null">#{status},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="reportId != null">#{reportId},</if>
<if test="dimensionId != null">#{dimensionId},</if>
<if test="dimensionName != null">#{dimensionName},</if>
<if test="qualityControlPointId != null">#{qualityControlPointId},</if>
<if test="qualityControlPointName != null">#{qualityControlPointName},</if>
<if test="indicatorId != null">#{indicatorId},</if>
<if test="indicatorName != null">#{indicatorName},</if>
<if test="schoolQualifiedStandard != null">#{schoolQualifiedStandard},</if>
<if test="secondaryCollegeStandard != null">#{secondaryCollegeStandard},</if>
<if test="personalTargetStandard != null">#{personalTargetStandard},</if>
<if test="detailsStatus != null">#{detailsStatus},</if>
NOW(),
NOW()
</trim>
</insert>
<insert id="saveOrUpdate" parameterType="java.util.List">
INSERT INTO dia_report_details
<trim prefix="(" suffix=")" suffixOverrides=",">
relId, reportName, user_id, stu_no, student_name,
submitter_type, college_id, college_name, status,
operator_id, report_id, dimension_id, dimension_name,
quality_control_point_id, quality_control_point_name,
indicator_id, indicator_name, school_qualified_standard,
secondary_college_standard, personal_target_standard,
details_status, created_at, updated_at
</trim>
VALUES
<foreach collection="list" item="item" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
#{item.relId}, #{item.reportName}, #{item.userId},
#{item.stuNo}, #{item.studentName}, #{item.submitterType},
#{item.collegeId}, #{item.collegeName}, #{item.status},
#{item.operatorId}, #{item.reportId}, #{item.dimensionId},
#{item.dimensionName}, #{item.qualityControlPointId},
#{item.qualityControlPointName}, #{item.indicatorId},
#{item.indicatorName}, #{item.schoolQualifiedStandard},
#{item.secondaryCollegeStandard}, #{item.personalTargetStandard},
#{item.detailsStatus}, NOW(), NOW()
</trim>
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";">
UPDATE dia_report_details
<set>
school_qualified_standard = #{item.schoolQualifiedStandard},
secondary_college_standard = #{item.secondaryCollegeStandard},
personal_target_standard = #{item.personalTargetStandard},
updated_at = NOW()
</set>
WHERE indicator_id = #{item.indicatorId}
<if test="item.userId != null">
AND user_id = #{item.userId}
</if>
</foreach>
</update>
<update id="updateDiaReportDetails" parameterType="DiaReportDetails">
UPDATE dia_report_details
<set>
<if test="relId != null">relId = #{relId},</if>
<if test="reportName != null">reportName = #{reportName},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="stuNo != null">stu_no = #{stuNo},</if>
<if test="studentName != null">student_name = #{studentName},</if>
<if test="submitterType != null">submitter_type = #{submitterType},</if>
<if test="collegeId != null">college_id = #{collegeId},</if>
<if test="collegeName != null">college_name = #{collegeName},</if>
<if test="status != null">status = #{status},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="reportId != null">report_id = #{reportId},</if>
<if test="dimensionId != null">dimension_id = #{dimensionId},</if>
<if test="dimensionName != null">dimension_name = #{dimensionName},</if>
<if test="qualityControlPointId != null">quality_control_point_id = #{qualityControlPointId},</if>
<if test="qualityControlPointName != null">quality_control_point_name = #{qualityControlPointName},</if>
<if test="indicatorId != null">indicator_id = #{indicatorId},</if>
<if test="indicatorName != null">indicator_name = #{indicatorName},</if>
<if test="schoolQualifiedStandard != null">school_qualified_standard = #{schoolQualifiedStandard},</if>
<if test="secondaryCollegeStandard != null">secondary_college_standard = #{secondaryCollegeStandard},</if>
<if test="personalTargetStandard != null">personal_target_standard = #{personalTargetStandard},</if>
<if test="detailsStatus != null">details_status = #{detailsStatus},</if>
updated_at = NOW()
</set>
WHERE id = #{id}
</update>
<delete id="deleteDiaReportDetailsById" parameterType="Long">
DELETE FROM dia_report_details WHERE id = #{id}
</delete>
<delete id="deleteDiaReportDetailsByIds" parameterType="Long">
DELETE FROM dia_report_details WHERE id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,111 @@
<?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.srs.diagnostic.mapper.DiaReportItemsMapper">
<resultMap type="DiaReportItems" id="DiaReportItemsResult">
<result property="itemId" column="itemId" />
<result property="reportId" column="reportId" />
<result property="dimension" column="dimension" />
<result property="controlPoint" column="control_point" />
<result property="indicatorName" column="indicator_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDiaReportItemsVo">
select itemId, reportId, dimension, control_point, indicator_name, create_by, create_time, update_by, update_time from dia_report_items
</sql>
<select id="selectDiaReportItemsList" parameterType="DiaReportItems" resultMap="DiaReportItemsResult">
<include refid="selectDiaReportItemsVo"/>
<where>
<if test="reportId != null "> and reportId = #{reportId}</if>
<if test="dimension != null and dimension != ''"> and dimension = #{dimension}</if>
<if test="controlPoint != null and controlPoint != ''"> and control_point = #{controlPoint}</if>
<if test="indicatorName != null and indicatorName != ''"> and indicator_name like concat('%', #{indicatorName}, '%')</if>
</where>
</select>
<select id="selectDiaReportItemsByItemId" parameterType="Long" resultMap="DiaReportItemsResult">
<include refid="selectDiaReportItemsVo"/>
where itemId = #{itemId}
</select>
<insert id="insertDiaReportItems" parameterType="DiaReportItems" useGeneratedKeys="true" keyProperty="itemId">
insert into dia_report_items
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportId != null">reportId,</if>
<if test="dimension != null">dimension,</if>
<if test="controlPoint != null">control_point,</if>
<if test="indicatorName != null">indicator_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportId != null">#{reportId},</if>
<if test="dimension != null">#{dimension},</if>
<if test="controlPoint != null">#{controlPoint},</if>
<if test="indicatorName != null">#{indicatorName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiaReportItems" parameterType="DiaReportItems">
update dia_report_items
<trim prefix="SET" suffixOverrides=",">
<if test="reportId != null">reportId = #{reportId},</if>
<if test="dimension != null">dimension = #{dimension},</if>
<if test="controlPoint != null">control_point = #{controlPoint},</if>
<if test="indicatorName != null">indicator_name = #{indicatorName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where itemId = #{itemId}
</update>
<delete id="deleteDiaReportItemsByItemId" parameterType="Long">
delete from dia_report_items where itemId = #{itemId}
</delete>
<delete id="deleteDiaReportItemsByItemIds" parameterType="String">
delete from dia_report_items where itemId in
<foreach item="itemId" collection="array" open="(" separator="," close=")">
#{itemId}
</foreach>
</delete>
<insert id="batchInsertReportItems" parameterType="java.util.List">
INSERT INTO dia_report_items (
reportId,
dimension,
control_point,
indicator_name,
create_by,
create_time,
update_by,
update_time
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.reportId},
#{item.dimension},
#{item.controlPoint},
#{item.indicatorName},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime}
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,113 @@
<?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.srs.diagnostic.mapper.DiaReportReleaseMapper">
<resultMap type="DiaReportRelease" id="DiaReportReleaseResult">
<result property="relId" column="relId" />
<result property="reportId" column="reportId" />
<result property="moduleName" column="moduleName" />
<result property="reportName" column="reportName" />
<result property="status" column="status" />
<result property="termId" column="term_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="stuYearName" column="stu_year_name" />
</resultMap>
<sql id="selectDiaReportReleaseVo">
select relId, reportId, moduleName, reportName, status, term_id, create_by, create_time from dia_report_release
</sql>
<select id="selectDiaReportReleaseList" parameterType="DiaReportRelease" resultMap="DiaReportReleaseResult">
<include refid="selectDiaReportReleaseVo"/>
<where>
<if test="moduleName != null and moduleName != ''"> and moduleName like concat('%', #{moduleName}, '%')</if>
<if test="reportName != null and reportName != ''"> and reportName like concat('%', #{reportName}, '%')</if>
<if test="termId !=0"> and term_id = #{termId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectDiaReportReleaseByRelId" parameterType="Long" resultMap="DiaReportReleaseResult">
<include refid="selectDiaReportReleaseVo"/>
where relId = #{relId}
</select>
<insert id="insertDiaReportRelease" parameterType="DiaReportRelease" useGeneratedKeys="true" keyProperty="relId">
insert into dia_report_release
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportId != null">reportId,</if>
<if test="moduleName != null and moduleName != ''">moduleName,</if>
<if test="reportName != null and reportName != ''">reportName,</if>
<if test="status != null and status != ''">status,</if>
<if test="termId !=0">term_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="stuYearName != null and stuYearName != ''">stu_year_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportId != null">#{reportId},</if>
<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
<if test="reportName != null and reportName != ''">#{reportName},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="termId !=0">#{termId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="stuYearName != null and stuYearName != ''">#{stuYearName},</if>
</trim>
</insert>
<insert id="insertItems" parameterType="DiaReportItems" useGeneratedKeys="true" keyProperty="itemId">
insert into dia_report_items
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportId != null">reportId,</if>
<if test="dimension != null">dimension,</if>
<if test="controlPoint != null">control_point,</if>
<if test="indicatorName != null">indicator_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportId != null">#{reportId},</if>
<if test="dimension != null">#{dimension},</if>
<if test="controlPoint != null">#{controlPoint},</if>
<if test="indicatorName != null">#{indicatorName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiaReportRelease" parameterType="DiaReportRelease">
update dia_report_release
<trim prefix="SET" suffixOverrides=",">
<if test="reportId != null">reportId = #{reportId},</if>
<if test="moduleName != null and moduleName != ''">moduleName = #{moduleName},</if>
<if test="reportName != null and reportName != ''">reportName = #{reportName},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="termId !=0">term_id = #{termId},</if> <!-- 修改判断条件 -->
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="stuYearName != null and stuYearName != ''">stu_year_name=#{stuYearName},</if>
</trim>
where relId = #{relId}
</update>
<delete id="deleteDiaReportReleaseByRelId" parameterType="Long">
delete from dia_report_release where relId = #{relId}
</delete>
<delete id="deleteDiaReportReleaseByRelIds" parameterType="String">
delete from dia_report_release where relId in
<foreach item="relId" collection="array" open="(" separator="," close=")">
#{relId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,479 @@
<?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.srs.diagnostic.mapper.DiaReportStandardsMapper">
<resultMap type="DiaReportStandards" id="DiaReportStandardsResult">
<result property="standardId" column="standardId" />
<result property="relId" column="relId" />
<result property="itemId" column="itemId" />
<result property="level" column="level" />
<result property="userName" column="user_name" />
<result property="standardValue" column="standard_value" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDiaReportStandardsVo">
select standardId, relId, itemId, level, user_name, standard_value, create_by, create_time, update_by, update_time from dia_report_standards
</sql>
<select id="selectDiaReportStandardsList" parameterType="DiaReportStandards" resultMap="DiaReportStandardsResult">
<include refid="selectDiaReportStandardsVo"/>
<where>
<if test="relId != null "> and relId = #{relId}</if>
<if test="itemId != null "> and itemId = #{itemId}</if>
<if test="level != null "> and level = #{level}</if>
<if test="userName != null "> and user_name like concat('%', #{userName}, '%')</if>
<if test="standardValue != null and standardValue != ''"> and standard_value = #{standardValue}</if>
</where>
</select>
<select id="selectDiaReportStandardsByStandardId" parameterType="Long" resultMap="DiaReportStandardsResult">
<include refid="selectDiaReportStandardsVo"/>
where standardId = #{standardId}
</select>
<insert id="insertDiaReportStandards" parameterType="DiaReportStandards" useGeneratedKeys="true" keyProperty="standardId">
insert into dia_report_standards
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="relId != null">relId,</if>
<if test="itemId != null">itemId,</if>
<if test="level != null">level,</if>
<if test="userName != null">user_name,</if>
<if test="standardValue != null">standard_value,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="relId != null">#{relId},</if>
<if test="itemId != null">#{itemId},</if>
<if test="level != null">#{level},</if>
<if test="userName != null">#{userName},</if>
<if test="standardValue != null">#{standardValue},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiaReportStandards" parameterType="DiaReportStandards">
update dia_report_standards
<trim prefix="SET" suffixOverrides=",">
<if test="relId != null">relId = #{relId},</if>
<if test="itemId != null">itemId = #{itemId},</if>
<if test="level != null">level = #{level},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="standardValue != null">standard_value = #{standardValue},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where standardId = #{standardId}
</update>
<delete id="deleteDiaReportStandardsByStandardId" parameterType="Long">
delete from dia_report_standards where standardId = #{standardId}
</delete>
<delete id="deleteDiaReportStandardsByStandardIds" parameterType="String">
delete from dia_report_standards where standardId in
<foreach item="standardId" collection="array" open="(" separator="," close=")">
#{standardId}
</foreach>
</delete>
<select id="getItemByReportId" parameterType="Long" resultType="DiaReportItems">
WITH RECURSIVE cte AS (
SELECT * FROM dia_reports WHERE reportId = #{reportId}
UNION ALL
SELECT dr.*
FROM dia_reports dr
INNER JOIN cte ON dr.parentId = cte.reportId
)
select * from
dia_report_items as a
left join cte on a.reportId = cte.reportId
where a.reportId in (
SELECT cte.reportId FROM cte
)
</select>
<select id="selectStandardDept" parameterType="DiaReportStandards" resultType="DiaReportStandards">
select a.*,b.dept_id
from dia_report_standards as a
left join sys_user as b on a.user_name COLLATE utf8mb4_general_ci = b.user_name COLLATE utf8mb4_general_ci
<where>
<if test="relId != null "> and a.relId = #{relId}</if>
<if test="itemId != null "> and a.itemId = #{itemId}</if>
<if test="level != null "> and a.level = #{level}</if>
<if test="deptId != null "> and b.dept_id = #{deptId}</if>
</where>
limit 1
</select>
<select id="selectStandardDeptBatch" resultType="DiaReportStandards">
select a.*,b.dept_id
from dia_report_standards as a
left join sys_user as b
on a.user_name COLLATE utf8mb4_general_ci = b.user_name COLLATE utf8mb4_general_ci
<where>
<if test="relId != null"> and a.relId = #{relId} </if>
<if test="level != null"> and a.level = #{level} </if>
<if test="deptId != null"> and b.dept_id = #{deptId} </if>
<if test="itemIds != null and itemIds.size() > 0">
and a.itemId in
<foreach collection="itemIds" item="itemId" open="(" separator="," close=")">
#{itemId}
</foreach>
</if>
</where>
</select>
<select id="countFinishNumByRelId" resultType="Map" parameterType="DiaReportStandards">
SELECT
COUNT(1) AS stu_num,
SUM(is_finish) AS finish_num
FROM (
SELECT
a.stu_no,
a.stu_name,
CASE
WHEN COUNT(dri.itemId) = SUM(CASE WHEN drsc.completed = 1 THEN 1 ELSE 0 END)
THEN 1 ELSE 0
END AS is_finish
FROM view_stu_info a
JOIN dia_report_items dri
ON dri.reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
LEFT JOIN dia_report_student_completion drsc
ON drsc.itemId = dri.itemId
AND drsc.relId = #{relId}
AND drsc.stu_no = a.stu_no
<where>
a.`status` NOT IN ('02','03')
<if test="deptId != null"> and a.dept_id = #{deptId} </if>
<if test="majorId != null"> and a.major_id = #{majorId} </if>
<if test="classId != null"> and a.class_id = #{classId} </if>
<if test="gradeId != null"> and a.grade_id = #{gradeId} </if>
<if test="fdyNo != null"> and a.t_no = #{fdyNo} </if>
</where>
GROUP BY a.stu_no, a.stu_name
) t
</select>
<select id="countItemFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
(stu_num * item_num) AS total_num,
finish_num
FROM
(SELECT COUNT(1) AS stu_num FROM view_stu_info
<where>
`status` NOT IN ('02','03')
<if test="deptId != null"> and dept_id = #{deptId} </if>
<if test="majorId != null"> and major_id = #{majorId} </if>
<if test="classId != null"> and class_id = #{classId} </if>
<if test="gradeId != null"> and grade_id = #{gradeId} </if>
<if test="fdyNo != null"> and t_no = #{fdyNo} </if>
</where>
) t1
CROSS JOIN (SELECT COUNT(1) AS item_num FROM dia_report_items WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})) t2
CROSS JOIN (
SELECT
COUNT(1) AS finish_num
FROM
dia_report_student_completion a
WHERE
a.relId = #{relId}
AND a.completed = 1
AND a.stu_no IN (SELECT stu_no FROM view_stu_info
<where>
`status` NOT IN ('02','03')
<if test="deptId != null"> and dept_id = #{deptId} </if>
<if test="majorId != null"> and major_id = #{majorId} </if>
<if test="classId != null"> and class_id = #{classId} </if>
<if test="gradeId != null"> and grade_id = #{gradeId} </if>
<if test="fdyNo != null"> and t_no = #{fdyNo} </if>
</where>
) AND a.itemId IN (SELECT itemId FROM dia_report_items WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId}))) t3;
</select>
<select id="countDeptItemFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
s.dept_name,
COUNT(DISTINCT s.stu_no) AS stu_num,
i.item_num,
COUNT(c.completionId) AS finish_num,
COUNT(DISTINCT s.stu_no) * i.item_num AS total_num
FROM
view_stu_info s
JOIN
(SELECT COUNT(1) AS item_num
FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
) i
LEFT JOIN dia_report_student_completion c
ON c.stu_no = s.stu_no AND c.relId = #{relId} AND c.completed = 1
AND c.itemId IN (
SELECT itemId FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
)
<where>
s.status NOT IN ('02', '03')
AND s.dept_name IS NOT NULL
<if test="gradeId != null"> and s.grade_id = #{gradeId} </if>
</where>
GROUP BY s.dept_name, i.item_num
</select>
<select id="countDeptFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
dept_name,
COUNT(1) AS stu_num,
SUM(is_finish) AS finish_num
FROM
(
SELECT
a.stu_no,
a.dept_name,
CASE
WHEN COUNT(dri.itemId) = SUM(CASE WHEN drsc.completed = 1 THEN 1 ELSE 0 END)
THEN 1 ELSE 0
END AS is_finish
FROM
view_stu_info a
JOIN dia_report_items dri ON dri.reportId = (
SELECT reportId FROM dia_report_release WHERE relId = #{relId}
)
LEFT JOIN dia_report_student_completion drsc
ON drsc.itemId = dri.itemId
AND drsc.relId = #{relId}
AND drsc.stu_no = a.stu_no
<where>
a.`status` NOT IN ('02','03') and a.dept_name is not null
<if test="gradeId != null"> and a.grade_id = #{gradeId} </if>
</where>
GROUP BY a.stu_no, a.dept_name
) t
GROUP BY dept_name
ORDER BY dept_name
;
</select>
<select id="countClassFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
dept_name,
major_name,
class_name,
COUNT(1) AS stu_num,
SUM(is_finish) AS finish_num
FROM
(
SELECT
a.stu_no,
a.dept_name, -- 这里加上
a.major_name,
a.class_name,
CASE
WHEN COUNT(dri.itemId) = SUM(CASE WHEN drsc.completed = 1 THEN 1 ELSE 0 END)
THEN 1 ELSE 0
END AS is_finish
FROM
view_stu_info a
JOIN dia_report_items dri ON dri.reportId = (
SELECT reportId FROM dia_report_release WHERE relId = #{relId}
)
LEFT JOIN dia_report_student_completion drsc
ON drsc.itemId = dri.itemId
AND drsc.relId = #{relId}
AND drsc.stu_no = a.stu_no
<where>
a.`status` NOT IN ('02','03') and a.dept_name is not null and a.major_name is not null
<if test="gradeId != null"> and a.grade_id = #{gradeId} </if>
<if test="deptId != null"> and a.dept_id = #{deptId} </if>
<if test="majorId != null"> and a.major_id = #{majorId} </if>
<if test="fdyNo != null"> and a.t_no = #{fdyNo} </if>
</where>
GROUP BY a.stu_no, a.dept_name, a.major_name,a.class_name
) t
GROUP BY dept_name, major_name,class_name
ORDER BY dept_name, major_name,class_name;
</select>
<select id="countMajorFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
dept_name,
major_name,
COUNT(1) AS stu_num,
SUM(is_finish) AS finish_num
FROM
(
SELECT
a.stu_no,
a.dept_name, -- 这里加上
a.major_name,
CASE
WHEN COUNT(dri.itemId) = SUM(CASE WHEN drsc.completed = 1 THEN 1 ELSE 0 END)
THEN 1 ELSE 0
END AS is_finish
FROM
view_stu_info a
JOIN dia_report_items dri ON dri.reportId = (
SELECT reportId FROM dia_report_release WHERE relId = #{relId}
)
LEFT JOIN dia_report_student_completion drsc
ON drsc.itemId = dri.itemId
AND drsc.relId = #{relId}
AND drsc.stu_no = a.stu_no
<where>
a.`status` NOT IN ('02','03') and a.dept_name is not null and a.major_name is not null
<if test="gradeId != null"> and a.grade_id = #{gradeId} </if>
<if test="deptId != null"> and a.dept_id = #{deptId} </if>
</where>
GROUP BY a.stu_no, a.dept_name, a.major_name
) t
GROUP BY dept_name, major_name
ORDER BY dept_name, major_name;
</select>
<select id="countClassItemFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
s.dept_name, -- 学院名称
s.major_name, -- 专业名称
s.class_name,
COUNT(DISTINCT s.stu_no) AS stu_num,
i.item_num,
COUNT(c.completionId) AS finish_num,
COUNT(DISTINCT s.stu_no) * i.item_num AS total_num
FROM
view_stu_info s
JOIN (
SELECT COUNT(1) AS item_num
FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId =#{relId})
) i
LEFT JOIN dia_report_student_completion c
ON c.stu_no = s.stu_no
AND c.relId = #{relId}
AND c.completed = 1
AND c.itemId IN (
SELECT itemId FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
)
<where>
s.`status` NOT IN ('02','03') and s.dept_name is not null and s.major_name is not null
<if test="gradeId != null"> and s.grade_id = #{gradeId} </if>
<if test="deptId != null"> and s.dept_id = #{deptId} </if>
<if test="majorId != null"> and s.major_id = #{majorId} </if>
<if test="fdyNo != null"> and s.t_no = #{fdyNo} </if>
</where>
GROUP BY s.dept_name, s.major_name,s.class_name, i.item_num
ORDER BY s.dept_name, s.major_name,s.class_name;
</select>
<select id="countMajorItemFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
s.dept_name, -- 学院名称
s.major_name, -- 专业名称
COUNT(DISTINCT s.stu_no) AS stu_num,
i.item_num,
COUNT(c.completionId) AS finish_num,
COUNT(DISTINCT s.stu_no) * i.item_num AS total_num
FROM
view_stu_info s
JOIN (
SELECT COUNT(1) AS item_num
FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId =#{relId})
) i
LEFT JOIN dia_report_student_completion c
ON c.stu_no = s.stu_no
AND c.relId = #{relId}
AND c.completed = 1
AND c.itemId IN (
SELECT itemId FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
)
<where>
s.`status` NOT IN ('02','03') and s.dept_name is not null and s.major_name is not null
<if test="gradeId != null"> and s.grade_id = #{gradeId} </if>
<if test="deptId != null"> and s.dept_id = #{deptId} </if>
</where>
GROUP BY s.dept_name, s.major_name, i.item_num
ORDER BY s.dept_name, s.major_name;
</select>
<select id="countGradeFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
grade_name,
COUNT(1) AS stu_num,
SUM(is_finish) AS finish_num
FROM
(
SELECT
a.stu_no,
a.grade_name,
CASE
WHEN COUNT(dri.itemId) = SUM(CASE WHEN drsc.completed = 1 THEN 1 ELSE 0 END)
THEN 1 ELSE 0
END AS is_finish
FROM
view_stu_info a
JOIN dia_report_items dri ON dri.reportId = (
SELECT reportId FROM dia_report_release WHERE relId = #{relId}
)
LEFT JOIN dia_report_student_completion drsc
ON drsc.itemId = dri.itemId
AND drsc.relId = #{relId}
AND drsc.stu_no = a.stu_no
<where>
a.`status` NOT IN ('02','03') and a.dept_name is not null and a.major_name is not null
and a.grade_name is not null
<if test="majorId != null"> and a.major_id = #{majorId} </if>
<if test="deptId != null"> and a.dept_id = #{deptId} </if>
</where>
GROUP BY a.stu_no, a.grade_name
) t
GROUP BY grade_name
ORDER BY grade_name;
</select>
<select id="countGradeItemFinishNumByRelId" parameterType="DiaReportStandards" resultType="Map">
SELECT
s.grade_name, -- 年级名称
COUNT(DISTINCT s.stu_no) AS stu_num,
i.item_num,
COUNT(c.completionId) AS finish_num,
COUNT(DISTINCT s.stu_no) * i.item_num AS total_num
FROM
view_stu_info s
JOIN (
SELECT COUNT(1) AS item_num
FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
) i
LEFT JOIN dia_report_student_completion c
ON c.stu_no = s.stu_no
AND c.relId = #{relId}
AND c.completed = 1
AND c.itemId IN (
SELECT itemId FROM dia_report_items
WHERE reportId = (SELECT reportId FROM dia_report_release WHERE relId = #{relId})
)
WHERE
s.`status` NOT IN ('02','03')
AND s.grade_name IS NOT NULL
<if test="deptId != null"> AND s.dept_id = #{deptId} </if>
<if test="majorId != null"> AND s.major_id = #{majorId} </if>
GROUP BY s.grade_name, i.item_num
ORDER BY s.grade_name;
</select>
</mapper>

View File

@@ -0,0 +1,97 @@
<?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.srs.diagnostic.mapper.DiaReportStudentCompletionMapper">
<resultMap type="DiaReportStudentCompletion" id="DiaReportStudentCompletionResult">
<result property="completionId" column="completionId" />
<result property="relId" column="relId" />
<result property="itemId" column="itemId" />
<result property="stuNo" column="stu_no" />
<result property="completed" column="completed" />
<result property="reason" column="reason" />
<result property="improvementMeasures" column="improvement_measures" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDiaReportStudentCompletionVo">
select completionId, relId, itemId, stu_no, completed, reason, improvement_measures, create_by, create_time, update_by, update_time from dia_report_student_completion
</sql>
<select id="selectDiaReportStudentCompletionList" parameterType="DiaReportStudentCompletion" resultMap="DiaReportStudentCompletionResult">
<include refid="selectDiaReportStudentCompletionVo"/>
<where>
<if test="relId != null "> and relId = #{relId}</if>
<if test="itemId != null "> and itemId = #{itemId}</if>
<if test="stuNo != null "> and stu_no = #{stuNo}</if>
<if test="completed != null "> and completed = #{completed}</if>
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
<if test="improvementMeasures != null and improvementMeasures != ''"> and improvement_measures = #{improvementMeasures}</if>
</where>
</select>
<select id="selectDiaReportStudentCompletionByCompletionId" parameterType="Long" resultMap="DiaReportStudentCompletionResult">
<include refid="selectDiaReportStudentCompletionVo"/>
where completionId = #{completionId}
</select>
<insert id="insertDiaReportStudentCompletion" parameterType="DiaReportStudentCompletion" useGeneratedKeys="true" keyProperty="completionId">
insert into dia_report_student_completion
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="relId != null">relId,</if>
<if test="itemId != null">itemId,</if>
<if test="stuNo != null">stu_no,</if>
<if test="completed != null">completed,</if>
<if test="reason != null">reason,</if>
<if test="improvementMeasures != null">improvement_measures,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="relId != null">#{relId},</if>
<if test="itemId != null">#{itemId},</if>
<if test="stuNo != null">#{stuNo},</if>
<if test="completed != null">#{completed},</if>
<if test="reason != null">#{reason},</if>
<if test="improvementMeasures != null">#{improvementMeasures},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiaReportStudentCompletion" parameterType="DiaReportStudentCompletion">
update dia_report_student_completion
<trim prefix="SET" suffixOverrides=",">
<if test="relId != null">relId = #{relId},</if>
<if test="itemId != null">itemId = #{itemId},</if>
<if test="stuNo != null">stu_no = #{stuNo},</if>
<if test="completed != null">completed = #{completed},</if>
<if test="reason != null">reason = #{reason},</if>
<if test="improvementMeasures != null">improvement_measures = #{improvementMeasures},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where completionId = #{completionId}
</update>
<delete id="deleteDiaReportStudentCompletionByCompletionId" parameterType="Long">
delete from dia_report_student_completion where completionId = #{completionId}
</delete>
<delete id="deleteDiaReportStudentCompletionByCompletionIds" parameterType="String">
delete from dia_report_student_completion where completionId in
<foreach item="completionId" collection="array" open="(" separator="," close=")">
#{completionId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,35 @@
<?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.srs.diagnostic.mapper.DiaReportSubmissionsMapper">
<resultMap type="DiaReportSubmissions" id="DiaReportSubmissionsResult">
<result property="relId" column="relId" />
<result property="reportId" column="reportId" />
<result property="moduleName" column="moduleName" />
<result property="reportName" column="reportName" />
<result property="status" column="status" />
<result property="term_id" column="term_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectDiaReportSubmissionsVo">
select relId, reportId, moduleName, reportName, status, term_id, create_by, create_time from dia_report_release where status=0
</sql>
<select id="selectDiaReportSubmissionsList" parameterType="DiaReportSubmissions" resultMap="DiaReportSubmissionsResult">
<include refid="selectDiaReportSubmissionsVo"/>
<where>
<if test="moduleName != null and moduleName != ''"> and moduleName like concat('%', #{moduleName}, '%')</if>
<if test="reportName != null and reportName != ''"> and reportName like concat('%', #{reportName}, '%')</if>
<if test="term_id != 0"> and term_id = #{term_id}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,161 @@
<?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.srs.diagnostic.mapper.DiaReportsMapper">
<resultMap type="DiaReports" id="DiaReportsResult">
<result property="reportId" column="reportId" />
<result property="name" column="name" />
<result property="parentId" column="parentId" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="sort" column="sort" />
<result property="isMoudId" column="isMoudId" />
</resultMap>
<sql id="selectDiaReportsVo">
select reportId, name, parentId, status, create_by, create_time, update_by, update_time,sort,isMoudId from dia_reports
</sql>
<select id="selectDiaReportsList" parameterType="DiaReports" resultMap="DiaReportsResult">
<include refid="selectDiaReportsVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="parentId != null "> and parentId = #{parentId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by sort asc
</select>
<select id="selectDiaReportsByReportId" parameterType="Integer" resultMap="DiaReportsResult">
<include refid="selectDiaReportsVo"/>
where reportId = #{reportId}
</select>
<select id="getNameList" resultType="com.srs.diagnostic.domain.DiaReports">
select reportId,name from dia_reports where parentId=0 and status=0
</select>
<select id="xlkList" resultMap="DiaReportsResult">
select reportId,name from dia_reports
where parentId = 0
</select>
<insert id="insertDiaReports" parameterType="DiaReports" useGeneratedKeys="true" keyProperty="reportId">
insert into dia_reports
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="parentId != null">parentId,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="sort != null">sort,</if>
<if test="isMoudId != null">isMoudId,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="parentId != null">#{parentId},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="sort != null">#{sort},</if>
<if test="isMoudId != null">#{isMoudId},</if>
</trim>
</insert>
<select id="getAllReports" resultType="com.srs.diagnostic.domain.DiaReports">
select reportId,name,parentId,status,create_by,create_time,update_by,update_time,sort from dia_reports
</select>
<insert id="insertReportItem" parameterType="DiaReportItems" useGeneratedKeys="true" keyProperty="itemId">
insert into dia_report_items
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportId != null">reportId,</if>
<if test="dimension != null">dimension,</if>
<if test="controlPoint != null">control_point,</if>
<if test="indicatorName != null">indicator_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportId != null">#{reportId},</if>
<if test="dimension != null">#{dimension},</if>
<if test="controlPoint != null">#{controlPoint},</if>
<if test="indicatorName != null">#{indicatorName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiaReports" parameterType="DiaReports">
update dia_reports
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="parentId != null">parentId = #{parentId},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="isMoudId != null">isMoudId = #{isMoudId},</if>
</trim>
where reportId = #{reportId}
</update>
<delete id="deleteDiaReportsByReportId" parameterType="Integer">
delete from dia_reports where reportId = #{reportId}
</delete>
<delete id="deleteDiaReportsByReportIds" parameterType="String">
delete from dia_reports where reportId in
<foreach item="reportId" collection="array" open="(" separator="," close=")">
#{reportId}
</foreach>
</delete>
<select id="selectAllReports" resultType="com.srs.diagnostic.domain.DiaReports" parameterType="Integer">
SELECT
reportId,
name,
parentId,
status,
create_by as createBy,
create_time as createTime,
update_by as updateBy,
update_time as updateTime,
sort,
isMoudId
FROM dia_reports
where isMoudId=#{reportId}
ORDER BY parentId, sort
</select>
<select id="selectChildrenByParentId" resultType="com.srs.diagnostic.domain.DiaReports">
SELECT
reportId,
name,
parentId,
status,
create_by as createBy,
create_time as createTime,
update_by as updateBy,
update_time as updateTime,
sort
FROM dia_reports
WHERE parentId = #{parentId}
ORDER BY sort
</select>
<select id="selectParentById" parameterType="Integer" resultType="com.srs.diagnostic.domain.DiaReports">
SELECT
reportId
FROM dia_reports
WHERE reportId = #{reportId} and parentId=0
</select>
</mapper>

View File

@@ -0,0 +1,120 @@
<?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.srs.diagnostic.mapper.DiaStudentInfoMapper">
<resultMap type="DiaStudentInfo" id="DiaStudentInfoResult">
<result property="id" column="id" />
<result property="stuNo" column="stu_no" />
<result property="collegeId" column="college_id" />
<!-- <result property="collegeName" column="college_name" />-->
<result property="collegeName" column="collegeName" />
<result property="majorId" column="major_id" />
<result property="majorName" column="major_name" />
<result property="userId" column="user_id" />
<!-- <result property="studentName" column="student_name" />-->
<result property="studentName" column="studentName" />
<result property="semesterId" column="semester_id" />
<!-- <result property="semesterName" column="semester_name" />-->
<result property="semesterName" column="semest_name" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="reportId" column="report_id" />
</resultMap>
<sql id="selectDiaStudentInfoVo">
select id, stu_no, college_id, college_name, major_id, major_name, user_id, student_name, semester_id, semester_name, create_time, update_time from dia_student_info
</sql>
<select id="selectDiaStudentInfoList" parameterType="DiaStudentInfo" resultMap="DiaStudentInfoResult">
SELECT
s.*,
u.nick_name AS studentName,
p.major_name AS major_name,
c.dept_name AS collegeName,
r.stu_year_name AS semest_name
FROM dia_student_info s
LEFT JOIN sys_user u ON s.user_id = u.user_id
LEFT JOIN srs_majors p ON s.college_id = p.college_id
LEFT JOIN sys_dept c ON s.college_id = c.dept_id
LEFT JOIN dia_report_release r ON s.report_id = r.relId
</select>
<select id="selectDiaStudentInfolistid" parameterType="Long" resultMap="DiaStudentInfoResult">
SELECT
s.*,
u.nick_name AS studentName,
p.major_name AS major_name,
c.dept_name AS collegeName,
r.stu_year_name AS semest_name
FROM dia_student_info s
LEFT JOIN sys_user u ON s.user_id = u.user_id
LEFT JOIN srs_majors p ON s.college_id = p.college_id
LEFT JOIN sys_dept c ON s.college_id = c.dept_id
LEFT JOIN dia_report_release r ON s.report_id = r.relId
where stu_no = #{userId}
</select>
<select id="selectDiaStudentInfoById" parameterType="Long" resultMap="DiaStudentInfoResult">
<include refid="selectDiaStudentInfoVo"/>
where id = #{id}
</select>
<insert id="insertDiaStudentInfo" parameterType="DiaStudentInfo" useGeneratedKeys="true" keyProperty="id">
insert into dia_student_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stuNo != null and stuNo != ''">stu_no,</if>
<if test="collegeId != null">college_id,</if>
<if test="collegeName != null and collegeName != ''">college_name,</if>
<if test="majorId != null">major_id,</if>
<if test="majorName != null and majorName != ''">major_name,</if>
<if test="userId != null">user_id,</if>
<if test="studentName != null and studentName != ''">student_name,</if>
<if test="semesterId != null">semester_id,</if>
<if test="semesterName != null and semesterName != ''">semester_name,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="reportId != null">report_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stuNo != null and stuNo != ''">#{stuNo},</if>
<if test="collegeId != null">#{collegeId},</if>
<if test="collegeName != null and collegeName != ''">#{collegeName},</if>
<if test="majorId != null">#{majorId},</if>
<if test="majorName != null and majorName != ''">#{majorName},</if>
<if test="userId != null">#{userId},</if>
<if test="studentName != null and studentName != ''">#{studentName},</if>
<if test="semesterId != null">#{semesterId},</if>
<if test="semesterName != null and semesterName != ''">#{semesterName},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="reportId != null">#{reportId},</if>
</trim>
ON DUPLICATE KEY UPDATE
<trim prefix="" suffixOverrides=",">
update_time = NOW(),
</trim>
</insert>
<update id="updateDiaStudentInfo" parameterType="DiaStudentInfo">
UPDATE dia_student_info s
LEFT JOIN dia_report_release r ON s.semester_id = r.term_id
SET s.semester_name = r.stu_year_name
WHERE r.term_id IS NOT NULL;
</update>
<delete id="deleteDiaStudentInfoById" parameterType="Long">
delete from dia_student_info where id = #{id}
</delete>
<delete id="deleteDiaStudentInfoByIds" parameterType="String">
delete from dia_student_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>