2023-08-10 21:09:49 +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.yanzhu.jh.project.mapper.SurProjectWorkAttendanceMapper" >
<resultMap type= "SurProjectWorkAttendance" id= "SurProjectWorkAttendanceResult" >
<result property= "id" column= "id" />
<result property= "prijectId" column= "priject_id" />
<result property= "deptId" column= "dept_id" />
<result property= "servicePersonnel" column= "service_personnel" />
<result property= "supervisorPersonnel" column= "supervisor_personnel" />
<result property= "contractorPersonnel" column= "contractor_personnel" />
<result property= "workDate" column= "work_date" />
<result property= "isDel" column= "is_del" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "remark" column= "remark" />
</resultMap>
<sql id= "selectSurProjectWorkAttendanceVo" >
select id, priject_id, dept_id, service_personnel, supervisor_personnel, contractor_personnel, work_date, is_del, create_by, create_time, update_by, update_time, remark from sur_project_work_attendance
</sql>
<select id= "selectSurProjectWorkAttendanceList" parameterType= "SurProjectWorkAttendance" resultMap= "SurProjectWorkAttendanceResult" >
<include refid= "selectSurProjectWorkAttendanceVo" />
<where >
<if test= "prijectId != null " > and priject_id = #{prijectId}</if>
<if test= "deptId != null " > and dept_id = #{deptId}</if>
<if test= "params.beginWorkDate != null and params.beginWorkDate != '' and params.endWorkDate != null and params.endWorkDate != ''" > and work_date between #{params.beginWorkDate} and #{params.endWorkDate}</if>
<if test= "isDel != null " > and is_del = #{isDel}</if>
</where>
</select>
<select id= "selectSurProjectWorkAttendanceById" parameterType= "Long" resultMap= "SurProjectWorkAttendanceResult" >
<include refid= "selectSurProjectWorkAttendanceVo" />
where id = #{id}
</select>
<insert id= "insertSurProjectWorkAttendance" parameterType= "SurProjectWorkAttendance" useGeneratedKeys= "true" keyProperty= "id" >
insert into sur_project_work_attendance
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "prijectId != null" > priject_id,</if>
<if test= "deptId != null" > dept_id,</if>
<if test= "servicePersonnel != null" > service_personnel,</if>
<if test= "supervisorPersonnel != null" > supervisor_personnel,</if>
<if test= "contractorPersonnel != null" > contractor_personnel,</if>
<if test= "workDate != null" > work_date,</if>
<if test= "isDel != null" > is_del,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "updateBy != null" > update_by,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "remark != null" > remark,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "prijectId != null" > #{prijectId},</if>
<if test= "deptId != null" > #{deptId},</if>
<if test= "servicePersonnel != null" > #{servicePersonnel},</if>
<if test= "supervisorPersonnel != null" > #{supervisorPersonnel},</if>
<if test= "contractorPersonnel != null" > #{contractorPersonnel},</if>
<if test= "workDate != null" > #{workDate},</if>
<if test= "isDel != null" > #{isDel},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "updateBy != null" > #{updateBy},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "remark != null" > #{remark},</if>
</trim>
</insert>
<update id= "updateSurProjectWorkAttendance" parameterType= "SurProjectWorkAttendance" >
update sur_project_work_attendance
<trim prefix= "SET" suffixOverrides= "," >
<if test= "prijectId != null" > priject_id = #{prijectId},</if>
<if test= "deptId != null" > dept_id = #{deptId},</if>
<if test= "servicePersonnel != null" > service_personnel = #{servicePersonnel},</if>
<if test= "supervisorPersonnel != null" > supervisor_personnel = #{supervisorPersonnel},</if>
<if test= "contractorPersonnel != null" > contractor_personnel = #{contractorPersonnel},</if>
<if test= "workDate != null" > work_date = #{workDate},</if>
<if test= "isDel != null" > is_del = #{isDel},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "remark != null" > remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id= "deleteSurProjectWorkAttendanceById" parameterType= "Long" >
delete from sur_project_work_attendance where id = #{id}
</delete>
<delete id= "deleteSurProjectWorkAttendanceByIds" parameterType= "String" >
delete from sur_project_work_attendance where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
2023-08-14 00:02:18 +08:00
<select id= "selectByDate" parameterType= "SurProjectWorkAttendance" resultMap= "SurProjectWorkAttendanceResult" >
<include refid= "selectSurProjectWorkAttendanceVo" />
<where >
<if test= "prijectId != null " > and priject_id = #{prijectId}</if>
<if test= "deptId != null " > and dept_id = #{deptId}</if>
<if test= "createTime != null" > and date(create_time)=date(#{createTime}) </if>
and is_del = 0
</where>
</select>
2023-08-10 21:09:49 +08:00
</mapper>