学生奖惩内容
This commit is contained in:
@@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
|
||||
<if test="deptId != null "> and d.dept_id = #{deptId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="teacherName != null and teacherName != ''"> and t.name like concat('%', #{teacherName}, '%')</if>
|
||||
|
||||
</where>
|
||||
order by class_code desc
|
||||
|
||||
@@ -33,35 +33,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectSrsKnrdApprovalRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="listView" parameterType="CphSearch" resultType="SrsKnrdApply">
|
||||
select a.*,d.major_type_name
|
||||
from srs_knrd_apply as a
|
||||
left join srs_student as b on a.xh = b.stu_no
|
||||
left join srs_class as c on b.class_id = c.class_id
|
||||
left join srs_majors as d on c.major_id = d.major_id
|
||||
left join cph_teacher as e on c.teacher_id = e.teacher_id
|
||||
-- left join srs_knrd_approval_record r on r.apply_id=a.id
|
||||
left join sys_dept_map as f on d.college_id = f.old_dept_id
|
||||
<select id="listView" parameterType="CphSearch" resultType="SrsKnrdApply">
|
||||
select a.*, d.major_type_name, g.step as latest_step, g.status as latest_status
|
||||
from srs_knrd_apply as a
|
||||
left join srs_student as b on a.xh = b.stu_no
|
||||
left join srs_class as c on b.class_id = c.class_id
|
||||
left join srs_majors as d on c.major_id = d.major_id
|
||||
left join cph_teacher as e on c.teacher_id = e.teacher_id
|
||||
left join sys_dept_map as f on d.college_id = f.old_dept_id
|
||||
left join (
|
||||
SELECT r1.*
|
||||
FROM srs_knrd_approval_record r1
|
||||
INNER JOIN (
|
||||
SELECT apply_id, MAX(id) as max_id
|
||||
FROM srs_knrd_approval_record
|
||||
GROUP BY apply_id
|
||||
) r2 ON r1.apply_id = r2.apply_id AND r1.id = r2.max_id
|
||||
) as g on g.apply_id = a.id
|
||||
where a.step != 0 and a.step != 1
|
||||
<if test="collegeId != null"> and d.college_id = #{collegeId}</if>
|
||||
<if test="tNo != null"> and e.employee_id = #{tNo}</if>
|
||||
<if test="deptId != null"> and f.new_dept_id = #{deptId}</if>
|
||||
<if test="stuNo != null"> and a.xh = #{stuNo}</if>
|
||||
<if test="sfzhm != null"> and a.sfzhm = #{sfzhm}</if>
|
||||
<if test="xm != null"> and a.xm like concat('%',#{xm},'%')</if>
|
||||
<if test="xh != null"> and a.xh like concat('%',#{xh},'%')</if>
|
||||
<if test="yj != null"> and (a.bjpyyj = #{yj} or a.ejxyldqmyj = #{yj} or a.xsqmyj = #{yj})</if>
|
||||
<if test="applyYear != null"> and a.apply_year like CONCAT('%',#{applyYear},'%')</if>
|
||||
order by a.id desc
|
||||
</select>
|
||||
|
||||
left join (
|
||||
SELECT * FROM srs_knrd_approval_record as record where id in(
|
||||
select MAX(id) FROM srs_knrd_approval_record GROUP BY apply_id
|
||||
)
|
||||
) as g on g.apply_id = a.id
|
||||
where a.step !=0 and a.step !=1
|
||||
<if test="collegeId !=null"> and d.college_id = #{collegeId}</if>
|
||||
<!-- <if test="step != null "> and r.step = #{step}</if>-->
|
||||
<if test="tNo != null "> and e.employee_id = #{tNo}</if>
|
||||
<if test="deptId != null "> and f.new_dept_id = #{deptId}</if>
|
||||
<if test="stuNo != null "> and a.xh = #{stuNo}</if>
|
||||
<if test="sfzhm != null "> and a.sfzhm = #{sfzhm}</if>
|
||||
<if test="xm != null "> and a.xm like concat('%',#{xm},'%')</if>
|
||||
<if test="xh != null "> and a.xh like concat('%',#{xh},'%')</if>
|
||||
<if test="yj != null "> and (a.bjpyyj = #{yj} or a.ejxyldqmyj = #{yj} or xsqmyj = #{yj})</if>
|
||||
<if test="applyYear != null "> and a.apply_year like CONCAT('%',#{applyYear},'%')</if>
|
||||
|
||||
order by a.id desc
|
||||
</select>
|
||||
<select id="selectSrsKnrdApprovalRecordByIds" resultType="SrsKnrdApprovalRecord">
|
||||
select * from srs_knrd_approval_record where apply_id=#{id}
|
||||
</select>
|
||||
|
||||
@@ -229,87 +229,97 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="listRecordView" parameterType="CphSearch" resultType="SrsZxjApply">
|
||||
select a.id as id,
|
||||
a.step as step,
|
||||
a.apply_year as apply_year,
|
||||
a.xm as xm,
|
||||
a.xb as xb,
|
||||
a.mz as mz,
|
||||
a.zzmm as zzmm,
|
||||
a.xh as xh,
|
||||
a.rxsj as rxsj,
|
||||
a.csny as csny,
|
||||
a.dh as dh,
|
||||
a.nj as nj,
|
||||
a.xy as xy,
|
||||
a.zy as zy,
|
||||
a.bj as bj,
|
||||
a.kndj as kndj,
|
||||
a.knlx as knlx,
|
||||
a.knlx2 as knlx2,
|
||||
a.rkzs as rkzs,
|
||||
a.yzsr as yzsr,
|
||||
a.rjyr as rjyr,
|
||||
a.srly as srly,
|
||||
a.jtcy as jtcy,
|
||||
a.sqly as sqly,
|
||||
a.fdyqm as fdyqm,
|
||||
a.fdyqmrq as fdyqmrq,
|
||||
a.ejxyldqm as ejxyldqm,
|
||||
a.ejxyldqmrq as ejxyldqmrq,
|
||||
a.xsqm as xsqm,
|
||||
a.xsqmrq as xsqmrq,
|
||||
a.csdj as csdj,
|
||||
a.zzdj as zzdj,
|
||||
a.zzls as zzls,
|
||||
a.zp as zp,
|
||||
a.create_id as create_id,
|
||||
a.affix_id as affix_id,
|
||||
a.status1 as status1,
|
||||
a.status2 as status2,
|
||||
a.status3 as status3,
|
||||
a.dz as dz,
|
||||
a.yb as yb,
|
||||
a.bjyj as bjyj,
|
||||
a.bjyjdj as bjyjdj,
|
||||
a.ejxyyj as ejxyyj,
|
||||
a.ejxyyjdj as ejxyyjdj,
|
||||
a.xxyj as xxyj,
|
||||
a.xxyjrq as xxyjrq,
|
||||
a.gyhd as gyhd,
|
||||
a.rjnsr as rjnsr,
|
||||
a.bankCard as bankCard,
|
||||
a.bankAddr as bankAddr,
|
||||
a.xxqm as xxqm,
|
||||
-- f.step as step,
|
||||
-- f.status as status,
|
||||
EXISTS(SELECT application_id FROM rt_stu_disciplinary_application rsda WHERE rsda.stu_no = a.xh and (penalty_status = 0 or penalty_status = 2)) as penalty_status0,
|
||||
EXISTS(SELECT application_id FROM rt_stu_disciplinary_application rsda WHERE rsda.stu_no = a.xh and (penalty_status = 1 )) as penalty_status1,
|
||||
EXISTS(SELECT application_id FROM rt_stu_disciplinary_application rsda WHERE rsda.stu_no = a.xh and (penalty_status = 3 )) as penalty_status3,
|
||||
a.sfzhm as sfzhm,d.major_type_name
|
||||
a.step as step,
|
||||
a.apply_year as apply_year,
|
||||
a.xm as xm,
|
||||
a.xb as xb,
|
||||
a.mz as mz,
|
||||
a.zzmm as zzmm,
|
||||
a.xh as xh,
|
||||
a.rxsj as rxsj,
|
||||
a.csny as csny,
|
||||
a.dh as dh,
|
||||
a.nj as nj,
|
||||
a.xy as xy,
|
||||
a.zy as zy,
|
||||
a.bj as bj,
|
||||
a.kndj as kndj,
|
||||
a.knlx as knlx,
|
||||
a.knlx2 as knlx2,
|
||||
a.rkzs as rkzs,
|
||||
a.yzsr as yzsr,
|
||||
a.rjyr as rjyr,
|
||||
a.srly as srly,
|
||||
a.jtcy as jtcy,
|
||||
a.sqly as sqly,
|
||||
a.fdyqm as fdyqm,
|
||||
a.fdyqmrq as fdyqmrq,
|
||||
a.ejxyldqm as ejxyldqm,
|
||||
a.ejxyldqmrq as ejxyldqmrq,
|
||||
a.xsqm as xsqm,
|
||||
a.xsqmrq as xsqmrq,
|
||||
a.csdj as csdj,
|
||||
a.zzdj as zzdj,
|
||||
a.zzls as zzls,
|
||||
a.zp as zp,
|
||||
a.create_id as create_id,
|
||||
a.affix_id as affix_id,
|
||||
a.status1 as status1,
|
||||
a.status2 as status2,
|
||||
a.status3 as status3,
|
||||
a.dz as dz,
|
||||
a.yb as yb,
|
||||
a.bjyj as bjyj,
|
||||
a.bjyjdj as bjyjdj,
|
||||
a.ejxyyj as ejxyyj,
|
||||
a.ejxyyjdj as ejxyyjdj,
|
||||
a.xxyj as xxyj,
|
||||
a.xxyjrq as xxyjrq,
|
||||
a.gyhd as gyhd,
|
||||
a.rjnsr as rjnsr,
|
||||
a.bankCard as bankCard,
|
||||
a.bankAddr as bankAddr,
|
||||
a.xxqm as xxqm,
|
||||
COALESCE(penalty.penalty_status0, 0) as penalty_status0,
|
||||
COALESCE(penalty.penalty_status1, 0) as penalty_status1,
|
||||
COALESCE(penalty.penalty_status3, 0) as penalty_status3,
|
||||
a.sfzhm as sfzhm,
|
||||
d.major_type_name
|
||||
from srs_zxj_apply as a
|
||||
left join srs_student as b on a.xh = b.stu_no
|
||||
left join srs_class as c on b.class_id = c.class_id
|
||||
left join srs_majors as d on c.major_id = d.major_id
|
||||
left join cph_teacher as e on c.teacher_id = e.teacher_id
|
||||
left join (
|
||||
SELECT * FROM srs_zxj_approval_record as record where id in(
|
||||
select MAX(id) FROM srs_zxj_approval_record GROUP BY apply_id
|
||||
)
|
||||
SELECT * FROM (
|
||||
SELECT *,
|
||||
ROW_NUMBER() OVER (PARTITION BY apply_id ORDER BY id DESC) as rn
|
||||
FROM srs_zxj_approval_record
|
||||
) record where rn = 1
|
||||
) as f on f.apply_id = a.id
|
||||
left join sys_dept_map as g on d.college_id = g.old_dept_id
|
||||
left join (
|
||||
SELECT stu_no,
|
||||
MAX(CASE WHEN penalty_status IN (0, 2) THEN 1 ELSE 0 END) as penalty_status0,
|
||||
MAX(CASE WHEN penalty_status = 1 THEN 1 ELSE 0 END) as penalty_status1,
|
||||
MAX(CASE WHEN penalty_status = 3 THEN 1 ELSE 0 END) as penalty_status3
|
||||
FROM rt_stu_disciplinary_application
|
||||
GROUP BY stu_no
|
||||
) penalty on penalty.stu_no = a.xh
|
||||
<where>
|
||||
<!-- <if test="step != null "> and exists (select apply_id from srs_zxj_approval_record r where r.step = ${step} and r.apply_id = a.id )</if>-->
|
||||
<if test="tNo != null "> and e.employee_id = #{tNo}</if>
|
||||
<if test="deptId != null "> and g.new_dept_id = #{deptId}</if>
|
||||
<if test="stuNo != null "> and a.xh = #{stuNo}</if>
|
||||
<if test="xm != null "> and a.xm like concat('%',#{xm},'%')</if>
|
||||
<if test="xh != null "> and a.xh like concat('%',#{xh},'%')</if>
|
||||
<if test="status != null "> and (a.status1 = #{status} or a.status2 = #{status} or a.status3 = #{status})</if>
|
||||
<if test="applyYear != null"> and a.apply_year like CONCAT('%',#{applyYear},'%')</if>
|
||||
<if test="tNo != null ">and e.employee_id = #{tNo}</if>
|
||||
<if test="deptId != null ">and g.new_dept_id = #{deptId}</if>
|
||||
<if test="stuNo != null ">and a.xh = #{stuNo}</if>
|
||||
<if test="xm != null ">and a.xm like concat('%',#{xm},'%')</if>
|
||||
<if test="xh != null ">and a.xh like concat('%',#{xh},'%')</if>
|
||||
<if test="status != null ">and (a.status1 = #{status} or a.status2 = #{status} or a.status3 = #{status})
|
||||
</if>
|
||||
<if test="applyYear != null">and a.apply_year like CONCAT('%',#{applyYear},'%')</if>
|
||||
</where>
|
||||
order by a.id desc
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertSrsZxjApply" parameterType="SrsZxjApply" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into srs_zxj_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
Reference in New Issue
Block a user