| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <?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="org.dromara.xg.mapper.XgStudentMsgBatchMapper">
- <!-- 查询学生信息完善的历史记录信息 -->
- <select id="selectHistoryByBatchId" parameterType="java.lang.Long" resultType="java.util.Map">
- SELECT
- xsmb.id,
- xsmb.name,
- xsmb.create_time AS createTime,
- xsmb.create_by AS createBy,
- s1.nick_name AS createByName,
- xsmb.last_audit_time AS auditTime,
- xsmb.update_by AS updateBy,
- s2.nick_name AS updateByName,
- xsmb.update_time AS updateTime,
- xsmb.info_status AS infoStatus,
- xsmb.deleted,
- xsmb.remark
- FROM xg_student_msg_batch xsmb
- inner join sys_user s1 on xsmb.create_by = s1.user_id
- inner join sys_user s2 on xsmb.update_by = s2.user_id
- WHERE batch_id = #{batchId}
- and xsmb.id = #{userId}
- ORDER BY xsmb.create_time DESC
- </select>
- <!-- 查询最后一次提交的信息(delete = 0的数据) -->
- <select id="selectCurrentByBatchId" parameterType="java.lang.Long" resultType="org.dromara.xg.domain.vo.XgStudentMsgBatchVo">
- SELECT * FROM xg_student_msg_batch
- WHERE batch_id = #{batchId} AND deleted = 0 and id = #{userId}
- ORDER BY create_time DESC
- </select>
- <!-- 逻辑删除当前登录人的历史数据(不更新update_by和update_time) -->
- <update id="logicalDeleteByUserId" parameterType="java.lang.Long">
- UPDATE xg_student_msg_batch
- SET deleted = 1
- WHERE id = #{userId} AND deleted = 0
- </update>
- <!-- 根据部门ID查询所有子部门ID列表(包括自己) -->
- <select id="selectChildDeptIds" parameterType="java.lang.Long" resultType="java.lang.Long">
- SELECT dept_id
- FROM sys_dept
- WHERE (dept_id = #{deptId} OR FIND_IN_SET(#{deptId}, ancestors))
- AND status = '0'
- AND del_flag = '0'
- </select>
- <!-- 根据部门ID列表和条件分页查询学生信息批次数据 -->
- <select id="selectPageByDeptIds" resultType="org.dromara.xg.domain.vo.XgStudentMsgBatchVo">
- SELECT
- xsmb.id,
- xsmb.deleted,
- xsmb.student_no,
- xsmb.id_card,
- xsmb.name,
- xsmb.name_english,
- xsmb.former_name,
- xsmb.gender,
- xsmb.birth_date,
- xsmb.nationality,
- xsmb.native_place,
- xsmb.political_status,
- xsmb.hukou_location,
- xsmb.home_address,
- xsmb.current_address,
- xsmb.postal_code,
- xsmb.photo_url,
- xsmb.photo_path,
- xsmb.phone,
- xsmb.is_boarder,
- xsmb.education_level,
- xsmb.household_register_type,
- xsmb.religion,
- xsmb.source_region,
- xsmb.graduate_school,
- xsmb.email,
- xsmb.qq,
- xsmb.wechat,
- xsmb.marital_status,
- xsmb.emergency_contact_name,
- xsmb.emergency_contact_phone,
- xsmb.emergency_contact_relation,
- xsmb.is_poor_student,
- xsmb.is_minority,
- xsmb.is_disabled,
- xsmb.is_orphan,
- xsmb.is_left_behind_child,
- xsmb.is_single_child,
- xsmb.is_low_income,
- xsmb.has_loan,
- xsmb.loan_amount,
- xsmb.specialties,
- xsmb.awards,
- xsmb.violations,
- xsmb.social_activities,
- xsmb.father_name,
- xsmb.father_phone,
- xsmb.father_work_unit,
- xsmb.mother_name,
- xsmb.mother_phone,
- xsmb.mother_work_unit,
- xsmb.guardian_name,
- xsmb.guardian_phone,
- xsmb.guardian_relation,
- xsmb.family_income,
- xsmb.per_capita_income,
- xsmb.income_source,
- xsmb.family_economic_status,
- xsmb.family_members,
- xsmb.height,
- xsmb.weight,
- xsmb.blood_type,
- xsmb.health_status,
- xsmb.special_condition,
- xsmb.medical_history,
- xsmb.allergies,
- xsmb.disability_type,
- xsmb.disability_level,
- xsmb.admission_category,
- xsmb.student_status,
- xsmb.enrollment_year,
- xsmb.enrollment_date,
- xsmb.bank_card_no,
- xsmb.bank_name,
- xsmb.bank_branch,
- xsmb.card_holder_name,
- xsmb.info_status,
- xsmb.data_source,
- xsmb.last_batch_id,
- xsmb.last_audit_time,
- xsmb.is_complete,
- xsmb.completion_rate,
- xsmb.school_system,
- xsmb.academic_level,
- xsmb.training_type,
- xsmb.major_id,
- xsmb.major_name,
- xsmb.class_id,
- xsmb.class_name,
- xsmb.grade,
- xsmb.college_id,
- xsmb.college_name,
- xsmb.counselor_id,
- xsmb.counselor_name,
- xsmb.class_teacher_id,
- xsmb.class_teacher_name,
- xsmb.dormitory_building,
- xsmb.dormitory_room,
- xsmb.ext_field1,
- xsmb.ext_field2,
- xsmb.ext_field3,
- xsmb.ext_field4,
- xsmb.ext_field5,
- xsmb.remark,
- xsmb.batch_id,
- xsmb.create_by,
- xsmb.create_time,
- xsmb.update_by,
- xsmb.update_time
- FROM xg_student_msg_batch xsmb
- WHERE xsmb.batch_id = #{batchId}
- AND xsmb.deleted = 0
- <if test="deptIds != null and deptIds.size() > 0">
- AND xsmb.class_id IN
- <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- <if test="name != null and name != ''">
- AND xsmb.name LIKE CONCAT('%', #{name}, '%')
- </if>
- <if test="studentNo != null and studentNo != ''">
- AND xsmb.student_no LIKE CONCAT('%', #{studentNo} , '%')
- </if>
- <if test="phone != null and phone != ''">
- AND xsmb.phone LIKE CONCAT('%', #{phone}, '%')
- </if>
- <if test="infoStatus != null and infoStatus != ''">
- AND xsmb.info_status = #{infoStatus}
- </if>
- ORDER BY xsmb.student_no DESC, xsmb.create_time DESC
- </select>
- <!-- 驳回学生信息提交 -->
- <update id="rejectStudentMsgByBatchIdAndUserId">
- UPDATE xg_student_msg_batch
- SET remark = #{remark},
- info_status = '4',
- update_by = #{currentUserId},
- update_time = NOW()
- WHERE batch_id = #{batchId}
- AND id = #{userId}
- AND deleted = 0
- </update>
- <!-- 审核通过学生信息提交 -->
- <update id="approveStudentMsgByBatchIdAndUserId">
- UPDATE xg_student_msg_batch
- SET remark = #{remark},
- info_status = '5',
- update_by = #{currentUserId},
- update_time = NOW()
- WHERE batch_id = #{batchId}
- AND id = #{userId}
- AND deleted = 0
- </update>
- </mapper>
|