2025-07-28 15:14:11 +08:00
|
|
|
<?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.comprehensive.mapper.CphAuditDetailsMapper">
|
2025-08-15 11:11:12 +08:00
|
|
|
|
2025-07-28 15:14:11 +08:00
|
|
|
<resultMap type="CphAuditDetails" id="CphAuditDetailsResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="projectName" column="project_name" />
|
|
|
|
|
<result property="submitterId" column="submitter_id" />
|
|
|
|
|
<result property="submitterName" column="submitter_name" />
|
|
|
|
|
<result property="reviewedById" column="reviewed_by_id" />
|
|
|
|
|
<result property="projectId" column="project_id" />
|
|
|
|
|
<result property="projectTypeId" column="project_type_id" />
|
|
|
|
|
<result property="statusCode" column="status_code" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="remarks" column="remarks" />
|
|
|
|
|
<result property="stuNo" column="stu_no" />
|
|
|
|
|
<result property="deptName" column="dept_name" />
|
|
|
|
|
<result property="majorsName" column="major_name" />
|
|
|
|
|
<result property="className" column="class_name" />
|
|
|
|
|
<association property="rules" column="project_type_id" javaType="cphRules" resultMap="CphRulesResult"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<resultMap type="CphRules" id="CphRulesResult">
|
|
|
|
|
<result property="ruleId" column="rule_id" />
|
|
|
|
|
<result property="ruleName" column="rule_name" />
|
|
|
|
|
<result property="parentId" column="parent_id" />
|
|
|
|
|
<result property="maxScore" column="max_score" />
|
|
|
|
|
<result property="minScore" column="min_score" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectCphAuditDetailsVo">
|
|
|
|
|
select id, project_name, submitter_id, submitter_name, reviewed_by_id, project_id, project_type_id, status_code,
|
|
|
|
|
ad.create_time, remarks,cr.*,s.stu_no,class_name,major_name,dept_name
|
|
|
|
|
from cph_audit_details ad
|
|
|
|
|
left join cph_rules cr on ad.project_type_id = cr.rule_id
|
|
|
|
|
left join srs_student s on s.stu_id = ad.submitter_id
|
|
|
|
|
left JOIN srs_class c ON s.class_id = c.class_id
|
|
|
|
|
left JOIN srs_majors m ON c.major_id = m.major_id
|
|
|
|
|
left JOIN sys_dept d ON m.college_id = d.dept_id
|
|
|
|
|
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectCphAuditDetailsList" parameterType="CphAuditDetails" resultMap="CphAuditDetailsResult">
|
|
|
|
|
<include refid="selectCphAuditDetailsVo"/>
|
2025-08-15 11:11:12 +08:00
|
|
|
<where>
|
2025-07-28 15:14:11 +08:00
|
|
|
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
|
|
|
|
<if test="submitterId != null "> and submitter_id = #{submitterId}</if>
|
|
|
|
|
<if test="submitterName != null and submitterName != ''"> and submitter_name like concat('%', #{submitterName}, '%')</if>
|
|
|
|
|
<if test="reviewedById != null "> and reviewed_by_id = #{reviewedById}</if>
|
|
|
|
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
|
|
|
|
<if test="projectTypeId != null "> and project_type_id = #{projectTypeId}</if>
|
|
|
|
|
<if test="statusCode != null "> and status_code = #{statusCode}</if>
|
|
|
|
|
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
|
|
|
|
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
|
|
|
|
|
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
<if test="majorsName != null and majorsName != ''"> and major_name like concat('%', #{majorsName}, '%')</if>
|
|
|
|
|
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
|
|
|
|
|
<if test="stuNo != null and stuNo != ''"> and s.stu_no like concat('%', #{stuNo}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by id desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listMyProcessed" parameterType="CphAuditDetails" resultMap="CphAuditDetailsResult">
|
|
|
|
|
<include refid="selectCphAuditDetailsVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="params.fdy != null ">
|
|
|
|
|
and submitter_id in (select stu_id from v_stu_teacher where teacher_id= #{params.fdy})
|
|
|
|
|
and status_code >= 2
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.jwc != null ">
|
|
|
|
|
and submitter_id in (select stu_id from v_stu_dept where user_id=#{params.jwc})
|
|
|
|
|
and status_code >=3
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
<if test="majorsName != null and majorsName != ''"> and major_name like concat('%', #{majorsName}, '%')</if>
|
|
|
|
|
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
|
|
|
|
|
<if test="stuNo != null and stuNo != ''"> and stu_no like concat('%', #{stuNo}, '%')</if>
|
|
|
|
|
<if test="gradeId != null "> and c.grade_id = #{gradeId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by id desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="searchCphAuditDetailsList" parameterType="CphAuditDetails" resultMap="CphAuditDetailsResult">
|
|
|
|
|
<include refid="selectCphAuditDetailsVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="stuNo != null and stuNo != ''"> and stu_no like concat('%', #{stuNo}, '%')</if>
|
|
|
|
|
<if test="stuName != null and stuName != ''"> and submitter_name like concat('%', #{stuName}, '%')</if>
|
|
|
|
|
<if test="statusCode != null "> and status_code = #{statusCode}</if>
|
|
|
|
|
<if test="params.fdy != null ">
|
|
|
|
|
and submitter_id in (select stu_id from v_stu_teacher where teacher_id= #{params.fdy})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.jwc != null ">
|
|
|
|
|
and submitter_id in (select stu_id from v_stu_dept where dept_id=#{params.jwc})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
<if test="majorsName != null and majorsName != ''"> and major_name like concat('%', #{majorsName}, '%')</if>
|
|
|
|
|
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
|
|
|
|
|
<if test="gradeId != null "> and c.grade_id = #{gradeId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by stu_no,id desc
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-08-15 11:11:12 +08:00
|
|
|
|
2025-07-28 15:14:11 +08:00
|
|
|
<select id="selectCphAuditDetailsById" parameterType="Long" resultMap="CphAuditDetailsResult">
|
|
|
|
|
<include refid="selectCphAuditDetailsVo"/>
|
|
|
|
|
where ad.id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectCphAuditDetailsByProjectId" parameterType="Long" resultMap="CphAuditDetailsResult">
|
|
|
|
|
<include refid="selectCphAuditDetailsVo"/>
|
|
|
|
|
where ad.project_id = #{id}
|
|
|
|
|
</select>
|
2025-08-15 11:11:12 +08:00
|
|
|
|
2025-07-28 15:14:11 +08:00
|
|
|
<insert id="insertCphAuditDetails" parameterType="CphAuditDetails" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into cph_audit_details
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="projectName != null">project_name,</if>
|
|
|
|
|
<if test="submitterId != null">submitter_id,</if>
|
|
|
|
|
<if test="submitterName != null">submitter_name,</if>
|
|
|
|
|
<if test="reviewedById != null">reviewed_by_id,</if>
|
|
|
|
|
<if test="projectId != null">project_id,</if>
|
|
|
|
|
<if test="projectTypeId != null">project_type_id,</if>
|
|
|
|
|
<if test="statusCode != null">status_code,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="remarks != null">remarks,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="projectName != null">#{projectName},</if>
|
|
|
|
|
<if test="submitterId != null">#{submitterId},</if>
|
|
|
|
|
<if test="submitterName != null">#{submitterName},</if>
|
|
|
|
|
<if test="reviewedById != null">#{reviewedById},</if>
|
|
|
|
|
<if test="projectId != null">#{projectId},</if>
|
|
|
|
|
<if test="projectTypeId != null">#{projectTypeId},</if>
|
|
|
|
|
<if test="statusCode != null">#{statusCode},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="remarks != null">#{remarks},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateCphAuditDetails" parameterType="CphAuditDetails">
|
|
|
|
|
update cph_audit_details
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="projectName != null">project_name = #{projectName},</if>
|
|
|
|
|
<if test="submitterId != null">submitter_id = #{submitterId},</if>
|
|
|
|
|
<if test="submitterName != null">submitter_name = #{submitterName},</if>
|
|
|
|
|
<if test="reviewedById != null">reviewed_by_id = #{reviewedById},</if>
|
|
|
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
|
|
|
<if test="projectTypeId != null">project_type_id = #{projectTypeId},</if>
|
|
|
|
|
<if test="statusCode != null">status_code = #{statusCode},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="remarks != null">remarks = #{remarks},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteCphAuditDetailsById" parameterType="Long">
|
|
|
|
|
delete from cph_audit_details where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteCphAuditDetailsByIds" parameterType="String">
|
2025-08-15 11:11:12 +08:00
|
|
|
delete from cph_audit_details where id in
|
2025-07-28 15:14:11 +08:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2025-08-16 00:30:18 +08:00
|
|
|
<update id="cancelAuditById" parameterType="Long">
|
2025-08-16 00:17:43 +08:00
|
|
|
update cph_iam set audit_status=1 where id=#{id}
|
2025-08-16 00:30:18 +08:00
|
|
|
</update>
|
2025-08-16 00:17:43 +08:00
|
|
|
<update id="cancelCphAudiDetailsById" parameterType="Long">
|
|
|
|
|
update cph_audit_details set status_code=1 where project_id=#{id}
|
2025-08-15 11:11:12 +08:00
|
|
|
</update>
|
2025-09-13 20:20:17 +08:00
|
|
|
|
|
|
|
|
<select id="listCancelRecord" resultType="SrsAddRecord">
|
|
|
|
|
select a.*
|
|
|
|
|
from srs_add_record as a
|
|
|
|
|
left join cph_iam as b on a.iam_id = b.id
|
|
|
|
|
where b.audit_status not in (6,12)
|
|
|
|
|
</select>
|
2025-08-15 11:11:12 +08:00
|
|
|
</mapper>
|