270 lines
11 KiB
XML
270 lines
11 KiB
XML
<?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.bgt.mapper.BgtProjectRecruitApplyMapper">
|
|
|
|
<resultMap type="com.ruoyi.bgt.domain.BgtProjectRecruitApply" id="BgtProjectRecruitApplyResult">
|
|
<result property="id" column="id"/>
|
|
<result property="recruitId" column="recruit_id"/>
|
|
<result property="userId" column="user_id"/>
|
|
<result property="delFlag" column="del_flag"/>
|
|
<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>
|
|
|
|
<select id="appQueryList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
|
select bpra.id,
|
|
bpra.entry_time,
|
|
bpra.leave_time,
|
|
bpra.recruit_id,
|
|
wu.user_id,
|
|
wu.phone,
|
|
wu.score,
|
|
wu.avatar_name,
|
|
wu.username,
|
|
wu.identity_card,
|
|
bpra.status,
|
|
wu.type_of_work,
|
|
bpr.recruit_name,
|
|
fpt.task_name,
|
|
bpr.task_id,
|
|
wsr.score as hasScore
|
|
from bgt_project_recruit_apply bpra
|
|
left join wgz_user wu on bpra.user_id = wu.user_id
|
|
left join bgt_project_recruit bpr on bpr.id = bpra.recruit_id
|
|
left join fbs_project_task fpt on fpt.id = bpr.task_id
|
|
left join wgz_score_record wsr on bpra.user_id = wsr.user_id and bpra.id = wsr.recruit_apply_id
|
|
<where>
|
|
<if test="dto.username !=null and dto.username !='' ">
|
|
and wu.username like concat('%', #{dto.username}, '%')
|
|
</if>
|
|
<if test="dto.taskId != null">
|
|
AND bpra.task_id = #{dto.taskId}
|
|
</if>
|
|
<!-- <if test="dto.recruitIds != null and dto.recruitIds.size() > 0">-->
|
|
<!-- AND bpra.recruit_id IN-->
|
|
<!-- <foreach collection="dto.recruitIds" item="recruitId" open="(" separator="," close=")">-->
|
|
<!-- #{recruitId}-->
|
|
<!-- </foreach>-->
|
|
<!-- </if>-->
|
|
<if test="dto.status != null and dto.status.size() > 0">
|
|
AND bpra.status IN
|
|
<foreach collection="dto.status" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="dto.date != null">
|
|
AND (entry_time between #{dto.beginDate} and #{dto.endDate}) or (leave_time between #{dto.beginDate} and #{dto.endDate})
|
|
</if>
|
|
</where>
|
|
order by bpra.create_time desc,bpra.status asc
|
|
</select>
|
|
|
|
<select id="dayAttendanceList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
|
select bpra.id,
|
|
bpra.entry_time,
|
|
wu.user_id,
|
|
wu.phone,
|
|
wu.score,
|
|
wu.avatar_name,
|
|
wu.username,
|
|
wu.type_of_work,
|
|
bpr.recruit_name,
|
|
fpt.task_name,
|
|
CASE
|
|
WHEN wa.leave_mark_id is not null THEN '请假'
|
|
WHEN wa.late =1 THEN '迟到'
|
|
WHEN wa.early_leave =1 THEN '早退'
|
|
WHEN wa.missed_in = 0 OR wa.missed_out = 0 THEN '出勤'
|
|
ELSE '缺勤'
|
|
END AS attendance_status
|
|
from wgz_attendance wa
|
|
left join wgz_user wu on wa.user_id = wu.user_id
|
|
left join bgt_project_recruit_apply bpra on wa.recruit_id = bpra.recruit_id and bpra.user_id = wa.user_id
|
|
left join bgt_project_recruit bpr on bpr.id = bpra.recruit_id
|
|
left join fbs_project_task fpt on fpt.id = bpr.task_id
|
|
where wa.date = #{dto.date}
|
|
<if test="dto.attendanceType !=null and dto.attendanceType ==1 ">
|
|
and (wa.missed_in =0 or wa.missed_out = 0 )
|
|
</if>
|
|
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
|
and (wa.missed_in =1 and wa.missed_out = 1)
|
|
</if>
|
|
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
|
and wa.late =1
|
|
</if>
|
|
</select>
|
|
|
|
|
|
<select id="todayAttendanceList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
|
SELECT bpra.id,
|
|
bpra.entry_time,
|
|
bpra.user_id,
|
|
wu.phone,
|
|
wu.score,
|
|
wu.avatar_name,
|
|
wu.username,
|
|
wu.type_of_work,
|
|
wu.identity_card,
|
|
bpr.recruit_name,
|
|
fpt.task_name,
|
|
bpra.task_id,
|
|
bpra.recruit_id,
|
|
CASE
|
|
WHEN wa.leave_mark_id IS NOT NULL THEN '请假'
|
|
WHEN wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0 THEN '正常'
|
|
WHEN wa.late = 1 OR wa.missed_in = 1 OR wa.early_leave = 1 OR wa.missed_out = 1 THEN '异常'
|
|
ELSE '异常'
|
|
END AS attendance_status
|
|
FROM bgt_project_recruit_apply bpra
|
|
LEFT JOIN bgt_project_recruit bpr ON bpr.id = bpra.recruit_id
|
|
LEFT JOIN fbs_project_task fpt ON fpt.id = bpr.task_id
|
|
LEFT JOIN wgz_user wu ON bpra.user_id = wu.user_id
|
|
LEFT JOIN wgz_attendance wa ON wa.user_id = wu.user_id AND wa.recruit_id = bpra.recruit_id AND wa.date = #{dto.date}
|
|
WHERE bpra.entry_time <= #{dto.date} and ((bpra.leave_time is null and bpra.status = '5')or leave_time>=#{dto.date})
|
|
and bpra.task_id = #{dto.taskId}
|
|
<if test="dto.attendanceType !=null and dto.attendanceType ==1 ">
|
|
and (wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0) and leave_mark_id is null
|
|
</if>
|
|
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
|
AND ((wa.late = 1 OR wa.missed_in = 1 OR wa.early_leave = 1 OR wa.missed_out = 1)
|
|
AND leave_mark_id IS NULL)
|
|
</if>
|
|
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
|
and wa.leave_mark_id IS NOT NULL
|
|
</if>
|
|
</select>
|
|
|
|
<select id="underwayPage" resultType="com.ruoyi.wgz.bo.res.WgzAppUnderwayRes">
|
|
SELECT
|
|
a.entry_time,
|
|
a.leave_time,
|
|
a.id as recruitApplyId,
|
|
b.*,
|
|
c.task_name,
|
|
c.task_address,
|
|
c.task_img,
|
|
c.create_time as taskCreateTime,
|
|
d.dict_label AS typeOfWorkLabel
|
|
FROM
|
|
bgt_project_recruit_apply as a
|
|
LEFT JOIN bgt_project_recruit as b on(a.recruit_id = b.id and b.del_flag = 0 )
|
|
LEFT JOIN fbs_project_task as c ON (b.task_id = c.id AND c.del_flag = 0)
|
|
LEFT JOIN sys_dict_data AS d ON ( d.dict_type = 'type_of_work' AND d.dict_value = b.type_of_work )
|
|
<where>
|
|
<if test="req.userId!=null and req.userId!=0 ">
|
|
a.user_id = #{req.userId} AND
|
|
</if>
|
|
<choose>
|
|
<when test="req.type!=null and req.type!='' and req.type == 1">
|
|
a.status IN ('3', '5') AND
|
|
</when>
|
|
<when test="req.type!=null and req.type!='' and req.type == 2">
|
|
a.status IN ('6') AND
|
|
</when>
|
|
</choose>
|
|
a.del_flag = 0
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<select id="recruitApplyList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
|
select bpra.id,
|
|
bpra.entry_time,
|
|
bpra.leave_time,
|
|
bpra.recruit_id,
|
|
wu.user_id,
|
|
wu.phone,
|
|
wu.score,
|
|
wu.avatar_name,
|
|
wu.username,
|
|
bpra.status,
|
|
wu.type_of_work,
|
|
bpr.recruit_name,
|
|
fpt.task_name,
|
|
bpr.task_id
|
|
from bgt_project_recruit_apply bpra
|
|
left join wgz_user wu on bpra.user_id = wu.user_id
|
|
left join bgt_project_recruit bpr on bpr.id = bpra.recruit_id
|
|
left join fbs_project_task fpt on fpt.id = bpr.task_id
|
|
<where>
|
|
<if test="dto.username !=null and dto.username !='' ">
|
|
and wu.username like concat('%', #{dto.username}, '%')
|
|
</if>
|
|
<if test="dto.recruitId != null">
|
|
and bpra.recruit_id = #{dto.recruitId}
|
|
</if>
|
|
<if test="dto.status != null and dto.status == 0">
|
|
AND bpra.status = '0'
|
|
</if>
|
|
<if test="dto.status != null and dto.status == 1">
|
|
AND bpra.status != '0'
|
|
</if>
|
|
</where>
|
|
order by wu.score desc,bpra.create_time desc
|
|
</select>
|
|
|
|
|
|
<select id="taskUserList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
|
select bpra.id,
|
|
bpra.entry_time,
|
|
bpra.leave_time,
|
|
bpra.recruit_id,
|
|
wu.user_id,
|
|
wu.phone,
|
|
wu.score,
|
|
wu.avatar_name,
|
|
wu.username,
|
|
wu.identity_card,
|
|
bpra.status,
|
|
wu.type_of_work,
|
|
bpr.recruit_name,
|
|
fpt.task_name,
|
|
bpr.task_id,
|
|
wsr.score as hasScore
|
|
from bgt_project_recruit_apply bpra
|
|
left join wgz_user wu on bpra.user_id = wu.user_id
|
|
left join bgt_project_recruit bpr on bpr.id = bpra.recruit_id
|
|
left join fbs_project_task fpt on fpt.id = bpr.task_id
|
|
left join wgz_score_record wsr on bpra.user_id = wsr.user_id and bpra.id = wsr.recruit_apply_id
|
|
<where>
|
|
<if test="dto.username !=null and dto.username !='' ">
|
|
and wu.username like concat('%', #{dto.username}, '%')
|
|
</if>
|
|
<if test="dto.taskId != null">
|
|
and bpra.task_id = #{dto.taskId}
|
|
</if>
|
|
<if test="dto.status != null and dto.status == 3">
|
|
AND bpra.status in ('1','3')
|
|
</if>
|
|
<if test="dto.status != null and dto.status != 3">
|
|
AND bpra.status = #{dto.status}
|
|
</if>
|
|
<if test="dto.status == null">
|
|
AND bpra.status in ('1','3','5','6')
|
|
</if>
|
|
</where>
|
|
order by bpra.create_time desc
|
|
</select>
|
|
|
|
|
|
<select id="userAllRecruitment" resultType="com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo">
|
|
SELECT
|
|
b.id as recruitId,
|
|
b.recruit_name
|
|
FROM
|
|
bgt_project_recruit_apply as a
|
|
LEFT JOIN bgt_project_recruit as b on(b.id = a.recruit_id)
|
|
WHERE
|
|
a.user_id = #{userId}
|
|
and (a.status = "5" or a.status = "6")
|
|
and a.del_flag = "0"
|
|
GROUP BY a.recruit_id
|
|
</select>
|
|
|
|
</mapper>
|