123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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.project.training.spec.mapper.TStPlanMapper">
- <resultMap type="TStPlan" id="TStPlanResult">
- <result property="id" column="id" />
- <result property="staffId" column="staff_id" />
- <result property="staffName" column="nick_name" />
- <result property="delFlag" column="del_flag" />
- <result property="createrCode" column="creater_code" />
- <result property="createdate" column="createdate" />
- <result property="updaterCode" column="updater_code" />
- <result property="updatedate" column="updatedate" />
- <result property="deptId" column="dept_id" />
- <result property="startDate" column="start_date" />
- <result property="endDate" column="end_date" />
- <result property="classHour" column="class_hour" />
- <result property="classContent" column="class_content" />
- <result property="studyState" column="study_state" />
- <result property="deptName" column="dept_name" />
- <result property="score" column="score" />
- <result property="overallComment" column="overall_comment" />
- <result property="approveStatus" column="APPROVE_STATUS" />
- <result property="dateOfCompletion" column="date_of_completion" />
- <result property="yearPlanId" column="year_plan_id" />
- </resultMap>
- <sql id="selectTStPlanVo">
- select d.year_plan_id,u1.nick_name as updateBy , u2.nick_name as createBy ,d.date_of_completion, suc.MENTOR_STAFF_ID, d.overall_comment, d.score, d.id, d.staff_id,d.APPROVE_STATUS, u.nick_name, d.plant_name, d.del_flag, d.createdate, d.updatedate, d.dept_id, d.start_date, d.end_date, d.class_hour, d.class_content, d.study_state ,s.dept_name from t_st_plan d
- left join sys_dept s on s.dept_id = d.dept_id
- left join sys_user u on d.staff_id = u.staffid
- LEFT JOIN SYS_USER u1 on d.updater_code = u1.USER_ID
- LEFT JOIN SYS_USER u2 on d.creater_code = u2.USER_ID
- left join T_ST_SUCCESSOR suc on d.STAFF_ID = suc.STAFF_ID
- </sql>
- <select id="selectTStPlanList" parameterType="TStPlan" resultMap="TStPlanResult">
- <include refid="selectTStPlanVo"/>
- <where>
- <if test="yearPlanId != null and yearPlanId != ''"> and d.year_plan_id = #{yearPlanId}</if>
- <if test="staffId != null and staffId != ''"> and d.staff_id = #{staffId}</if>
- <if test="plantName != null and plantName != ''"> and plant_name like concat(concat('%', #{plantName}), '%')</if>
- <if test="startDate != null "> and start_date = #{startDate}</if>
- <if test="endDate != null "> and end_date = #{endDate}</if>
- <if test="classHour != null and classHour != ''"> and class_hour = #{classHour}</if>
- <if test="studyState != null and studyState != ''"> and study_state = #{studyState}</if>
- <if test="mentorStaffId != null and mentorStaffId != ''"> and mentor_staff_id = #{mentorStaffId}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- </select>
- <select id="selectTStPlanById" parameterType="Long" resultMap="TStPlanResult">
- <include refid="selectTStPlanVo"/>
- where d.id = #{id}
- </select>
- <insert id="insertTStPlan" parameterType="TStPlan">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_st_plan.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_st_plan
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="staffId != null">staff_id,</if>
- <if test="plantName != null">plant_name,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createrCode != null">creater_code,</if>
- <if test="createdate != null">createdate,</if>
- <if test="updaterCode != null">updater_code,</if>
- <if test="updatedate != null">updatedate,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="startDate != null">start_date,</if>
- <if test="endDate != null">end_date,</if>
- <if test="classHour != null">class_hour,</if>
- <if test="classContent != null">class_content,</if>
- <if test="studyState != null">study_state,</if>
- <if test="approveStatus != null">APPROVE_STATUS,</if>
- <if test="yearPlanId != null">year_plan_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="staffId != null">#{staffId},</if>
- <if test="plantName != null">#{plantName},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createrCode != null">#{createrCode},</if>
- <if test="createdate != null">#{createdate},</if>
- <if test="updaterCode != null">#{updaterCode},</if>
- <if test="updatedate != null">#{updatedate},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="startDate != null">#{startDate},</if>
- <if test="endDate != null">#{endDate},</if>
- <if test="classHour != null">#{classHour},</if>
- <if test="classContent != null">#{classContent},</if>
- <if test="studyState != null">#{studyState},</if>
- <if test="approveStatus != null">#{approveStatus},</if>
- <if test="yearPlanId != null">#{yearPlanId},</if>
- </trim>
- </insert>
- <update id="updateTStPlan" parameterType="TStPlan">
- update t_st_plan
- <trim prefix="SET" suffixOverrides=",">
- <if test="staffId != null">staff_id = #{staffId},</if>
- <if test="plantName != null">plant_name = #{plantName},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createrCode != null">creater_code = #{createrCode},</if>
- <if test="createdate != null">createdate = #{createdate},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="startDate != null">start_date = #{startDate},</if>
- <if test="endDate != null">end_date = #{endDate},</if>
- <if test="classHour != null">class_hour = #{classHour},</if>
- <if test="classContent != null">class_content = #{classContent},</if>
- <if test="studyState != null">study_state = #{studyState},</if>
- <if test="score != null">
- score = #{score},
- <!-- 王子文 2022年4月22日 添加 -->
- <!-- 导师反馈的同时更新实际完成培训日期为当前日期 -->
- date_of_completion = SYSDATE,
- </if>
- <if test="overallComment != null">overall_comment = #{overallComment},</if>
- <if test="approveStatus != null">approve_status = #{approveStatus},</if>
- <if test="dateOfCompletion != null"></if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTStPlanById" parameterType="Long">
- update t_st_plan set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTStPlanByIds" parameterType="String">
- update t_st_plan set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|