|
@@ -3,11 +3,13 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.project.training.mapper.TTrainingHisparticipantsMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TTrainingHisparticipants" id="TTrainingHisparticipantsResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="staffId" column="staff_id" />
|
|
|
<result property="companyId" column="company_id" />
|
|
|
+ <result property="courseCode" column="course_code" />
|
|
|
+ <result property="item" column="item" />
|
|
|
<result property="startDate" column="start_date" />
|
|
|
<result property="endDate" column="end_date" />
|
|
|
<result property="score" column="score" />
|
|
@@ -26,13 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTTrainingHisparticipantsVo">
|
|
|
- select d.id, d.staff_id, d.company_id, d.start_date, d.end_date, d.score, d.operation_score, d.training_place, d.training_duration, d.training_cost, d.budget, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate ,s.dept_name from t_training_hisparticipants d
|
|
|
+ select d.id, d.staff_id, d.company_id,d.course_code, d.item, d.start_date, d.end_date, d.score, d.operation_score, d.training_place, d.training_duration, d.training_cost, d.budget, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate ,s.dept_name from t_training_hisparticipants d
|
|
|
left join sys_dept s on s.dept_id = d.dept_id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTTrainingHisparticipantsList" parameterType="TTrainingHisparticipants" resultMap="TTrainingHisparticipantsResult">
|
|
|
<include refid="selectTTrainingHisparticipantsVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="staffId != null "> and staff_id = #{staffId}</if>
|
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
<if test="startDate != null "> and start_date = #{startDate}</if>
|
|
@@ -76,12 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
order by start_date
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTTrainingHisparticipantsById" parameterType="Long" resultMap="TTrainingHisparticipantsResult">
|
|
|
<include refid="selectTTrainingHisparticipantsVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertTTrainingHisparticipants" parameterType="TTrainingHisparticipants">
|
|
|
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
|
|
SELECT seq_t_training_hisparticipants.NEXTVAL as id FROM DUAL
|
|
@@ -105,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createdate != null">createdate,</if>
|
|
|
<if test="updaterCode != null">updater_code,</if>
|
|
|
<if test="updatedate != null">updatedate,</if>
|
|
|
+ <if test="courseCode != null">course_code,</if>
|
|
|
+ <if test="item != null">item,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">#{id},</if>
|
|
@@ -124,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createdate != null">#{createdate},</if>
|
|
|
<if test="updaterCode != null">#{updaterCode},</if>
|
|
|
<if test="updatedate != null">#{updatedate},</if>
|
|
|
+ <if test="courseCode != null">#{courseCode},</if>
|
|
|
+ <if test="item != null">#{item},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -146,6 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createdate != null">createdate = #{createdate},</if>
|
|
|
<if test="updaterCode != null">updater_code = #{updaterCode},</if>
|
|
|
<if test="updatedate != null">updatedate = #{updatedate},</if>
|
|
|
+ <if test="courseCode != null">course_code = #{courseCode},</if>
|
|
|
+ <if test="item != null">item = #{item},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -160,5 +168,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <delete id="duplicateHiParticipants">
|
|
|
+ DELETE
|
|
|
+ FROM T_TRAINING_HISPARTICIPANTS
|
|
|
+ where rowid !=( select max(rowid)
|
|
|
+ from T_TRAINING_HISPARTICIPANTS b
|
|
|
+ where b.STAFF_ID = T_TRAINING_HISPARTICIPANTS.STAFF_ID
|
|
|
+ and b.COURSE_CODE = T_TRAINING_HISPARTICIPANTS.COURSE_CODE
|
|
|
+ and b.START_DATE = T_TRAINING_HISPARTICIPANTS.START_DATE
|
|
|
+ )
|
|
|
+ </delete>
|
|
|
+</mapper>
|