266 lines
12 KiB
XML
266 lines
12 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.bonus.gzrn.rnama.personnel.dao.migrantDao">
|
|
<insert id="insertInfo" parameterType="com.bonus.gzrn.rnama.personnel.entity.migrantBean">
|
|
insert into rl_idcard_check (name,idcard,people_date,source,user_id)
|
|
values (#{trueName},#{idCard},#{date},#{source},#{userId})
|
|
</insert>
|
|
<update id="updateiInfoById">
|
|
update rl_idcard_check set name=#{trueName},idcard=#{idCard},people_date=#{date} where user_id=#{userId}
|
|
</update>
|
|
|
|
<select id="getCheckInfo" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(1)
|
|
FROM
|
|
rl_idcard_check
|
|
WHERE
|
|
user_id = #{0}
|
|
</select>
|
|
<select id="findbyName" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
bm_blacklist_worker
|
|
WHERE
|
|
id_number = #{idcard}
|
|
</select>
|
|
|
|
<select id="getEmploymentAnnouncementData"
|
|
resultType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean">
|
|
select id,project,subcontract,team_category teamCategory,contact_person contactPerson,contact_way contactWay,release_time releaseTime
|
|
from rl_labor_release where is_active = '1' and is_online ='1'
|
|
<if test="keyWord != null and keyWord != '' ">
|
|
and (
|
|
project like concat('%',#{keyWord},'%') OR
|
|
subcontract like concat('%',#{keyWord},'%') OR
|
|
team_category like concat('%',#{keyWord},'%') OR
|
|
contact_person like concat('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
<select id="getJobAnnouncementData"
|
|
resultType="com.bonus.gzrn.rnama.personnel.entity.migrantBean">
|
|
select id,number as numberPeople,holder as holderReq,type_work workType,
|
|
team_monitor as contact,team_telep as contactWay,release_time releaseTime,
|
|
team_type as teamType
|
|
from rl_migrant_release where is_active = '1' and is_online ='1'
|
|
<if test="keyWord != null and keyWord != '' ">
|
|
and (
|
|
team_monitor like concat('%',#{keyWord},'%') OR
|
|
holder like concat('%',#{keyWord},'%') OR
|
|
team_type like concat('%',#{keyWord},'%') OR
|
|
type_work like concat('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
<select id="getIdNumber" resultType="com.bonus.gzrn.rnama.personnel.entity.migrantBean">
|
|
select name,idcard from rl_idcard_check where user_id = #{userId}
|
|
</select>
|
|
<select id="getWorkNoticeById" parameterType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean" resultType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean">
|
|
select release_time releaseTime,project,subcontract,team_category teamCategory,number_people numberPeople,team_number teamNumber,
|
|
holder_req holderReq,contact_person contactPerson,contact_way contactWay,remark
|
|
from rl_labor_release where id = #{id}
|
|
</select>
|
|
<select id="getJobNoticeById" parameterType="com.bonus.gzrn.rnama.personnel.entity.migrantBean" resultType="com.bonus.gzrn.rnama.personnel.entity.migrantBean">
|
|
select number,holder,type_work as workType,work_history workHistory,contact,contact_way contactWay,remark,release_time releaseTime
|
|
from rl_migrant_release where id = #{id}
|
|
</select>
|
|
|
|
|
|
<insert id="addYGMessage" parameterType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean">
|
|
insert into rl_labor_release
|
|
(project,subcontract,team_category,number_people,team_number,holder_req,contact_person,contact_way,remark,release_time,is_active,is_online,release_status,source,release_person,user_id)
|
|
values (#{project},#{subcontract},#{teamCategory},#{numberPeople},#{teamNumber},#{holderReq},#{contactPerson},#{contactWay},#{remark},#{releaseTime},'1','1','0','1',#{releasePerson},#{userId})
|
|
</insert>
|
|
|
|
<select id="getReleaseWorkInfoList" resultType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean">
|
|
SELECT
|
|
re.id,
|
|
re.project,
|
|
re.subcontract,
|
|
re.number_people as numberPeople,
|
|
re.team_category AS teamCategory,
|
|
re.team_number AS teamNumber,
|
|
re.holder_req AS holderReq,
|
|
re.contact_person AS contactPerson,
|
|
re.contact_way AS contactWay,
|
|
re.remark,
|
|
re.release_time AS releaseTime,
|
|
re.release_person AS releasePersonId,
|
|
IFNULL( re.release_status, 0) AS releaseStatus,
|
|
sys.USERNAME as releasePerson,
|
|
rc.release_way as releaseWay,
|
|
re.is_online AS isOnline,
|
|
re.scbrelease_person AS scbreleasePerson,
|
|
re.source,
|
|
re.audit_time AS auditTime,
|
|
re.is_active AS isActive
|
|
FROM
|
|
rl_labor_release re
|
|
LEFT JOIN rl_contact_maintenance rc on rc.id = re.release_person
|
|
LEFT JOIN sys_user sys on sys.ID = rc.release_people
|
|
WHERE re.is_active = '1'
|
|
<!-- <if test="userType = 3 or userType = '3'">
|
|
and user_id = #{userId}
|
|
</if>-->
|
|
<if test="project !=null and project != '' ">
|
|
AND re.project LIKE concat ('%',#{project},'%')
|
|
</if>
|
|
<if test="releaseStatus != null and releaseStatus != '' ">
|
|
AND re.release_status = #{releaseStatus}
|
|
</if>
|
|
ORDER BY re.release_time DESC
|
|
</select>
|
|
|
|
<select id="getReleasePerson" parameterType="string" resultType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean">
|
|
select rc.id,sys.USERNAME as releasePerson,rc.release_way as releaseWay,rc.audit_type,rc.is_enable,rc.is_active
|
|
from rl_contact_maintenance rc
|
|
LEFT JOIN sys_user sys on sys.ID = rc.release_people
|
|
where rc.is_enable ='1' and rc.is_active = '1' and rc.audit_type =#{auditType}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="getWorkInfoReleaseList" resultType="com.bonus.gzrn.rnama.personnel.entity.migrantBean">
|
|
select rm.id,rm.number,rm.holder,rm.type_work as typeWork,rm.work_history as workHistory,
|
|
rm.remark,rm.release_time as releaseTime,IFNULL(ss.USERNAME,'无') as auditPerson,rm.audit_tel as auditTel,rm.audit_result as auditResult,
|
|
rm.is_online as isOnline,rm.source,rm.audit_time as auditTime,rm.is_active as isActive,rm.user_id as userId,
|
|
rm.team_type as teamType,rm.team_monitor as teamMonitor,rm.idcard as idCard,rm.team_telep as teamTelep
|
|
from rl_migrant_release rm
|
|
LEFT JOIN sys_user sys on sys.ID = rm.user_id
|
|
LEFT JOIN rl_contact_maintenance rc on rc.id = rm.audit_person
|
|
LEFT JOIN sys_user ss on ss.ID = rc.release_people
|
|
where rm.is_active = '1'
|
|
<if test="userType == 3 or userType == '3'">
|
|
and rm.user_id = #{userId}
|
|
</if>
|
|
<if test="auditResult != null and auditResult != '' ">
|
|
AND rm.audit_result = #{auditResult}
|
|
</if>
|
|
<if test="keyWord != null and keyWord != '' ">
|
|
and (
|
|
rm.team_monitor like concat ('%',#{keyWord},'%') or
|
|
rm.holder like concat ('%',#{keyWord},'%') or
|
|
rm.type_work like concat ('%',#{keyWord},'%') or
|
|
rm.remark like concat ('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
ORDER BY rm.release_time DESC
|
|
</select>
|
|
|
|
<insert id="addWGMessage" parameterType="com.bonus.gzrn.rnama.personnel.entity.NewMigrantBean" useGeneratedKeys = "true" keyProperty = "id" >
|
|
insert into rl_migrant_release (number,holder,type_work,remark,
|
|
release_time,audit_person,audit_tel,audit_result,is_online,
|
|
source,audit_time,is_active,user_id,team_type,
|
|
team_monitor,idcard,team_telep
|
|
)
|
|
values (#{number},#{holder},#{typeWork},#{remark},
|
|
#{releaseTime},#{auditPerson},#{auditTel},'0','1',
|
|
'1',#{auditTime},'1',#{userId},#{teamType},
|
|
#{teamMonitor},#{idCard},#{teamTelep}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="addPersonMessage" parameterType="com.bonus.gzrn.rnama.personnel.entity.NewPersonMessage">
|
|
insert into rl_migrant_soninfo (
|
|
true_name,sex,old,team_work,holder,work_history,labor_id
|
|
) values (
|
|
#{name},#{sex},#{age},#{workType},#{credentials},#{resume},#{laborId}
|
|
);
|
|
</insert>
|
|
|
|
|
|
<update id="updateStatus" parameterType="string">
|
|
update ${tableName} set ${type} = '0' where id = #{id}
|
|
</update>
|
|
|
|
|
|
<select id="getYGDetailsById" parameterType="string" resultType="com.bonus.gzrn.rnama.personnel.entity.releaseWorkInfoBean">
|
|
SELECT
|
|
re.id,
|
|
re.project,
|
|
re.subcontract,
|
|
re.number_people as numberPeople,
|
|
re.team_category AS teamCategory,
|
|
re.team_number AS teamNumber,
|
|
re.holder_req AS holderReq,
|
|
re.contact_person AS contactPerson,
|
|
re.contact_way AS contactWay,
|
|
re.remark,
|
|
re.release_time AS releaseTime,
|
|
re.release_person AS releasePersonId,
|
|
IFNULL( re.release_status, 0) AS releaseStatus,
|
|
rc.release_people as releasePerson,
|
|
rc.release_way as releaseWay,
|
|
re.is_online AS isOnline,
|
|
re.scbrelease_person AS scbreleasePerson,
|
|
re.source,
|
|
re.audit_time AS auditTime,
|
|
re.is_active AS isActive
|
|
FROM
|
|
rl_labor_release re
|
|
LEFT JOIN rl_contact_maintenance rc on rc.id = re.release_person
|
|
WHERE re.id = #{id}
|
|
</select>
|
|
|
|
<select id="getWGDetailsById" parameterType="string" resultType="com.bonus.gzrn.rnama.personnel.entity.migrantBean">
|
|
select rm.id,rm.number,rm.holder,rm.type_work as typeWork,rm.work_history as workHistory,
|
|
rm.remark,rm.release_time as releaseTime,rm.audit_person as auditPerson,rm.audit_tel as auditTel,rm.audit_result as auditResult,
|
|
rm.is_online as isOnline,rm.source,rm.audit_time as auditTime,rm.is_active as isActive,rm.user_id as userId,
|
|
rm.team_type as teamType,rm.team_monitor as teamMonitor,rm.idcard as idCard,rm.team_telep as teamTelep
|
|
from rl_migrant_release rm
|
|
LEFT JOIN sys_user sys on sys.ID = rm.user_id
|
|
LEFT JOIN rl_contact_maintenance rc on rc.id = rm.audit_person
|
|
where rm.id = #{id}
|
|
</select>
|
|
<select id="getWGPersonById" parameterType="string" resultType = "com.bonus.gzrn.rnama.personnel.entity.NewPersonMessage">
|
|
select true_name as name,sex,old as age,team_work as workType,
|
|
holder as credentials,work_history as resume,labor_id as laborId
|
|
from rl_migrant_soninfo
|
|
where labor_id = #{ids}
|
|
</select>
|
|
|
|
<select id="getOutstandingData" resultType="com.bonus.gzrn.rnama.personnel.entity.OutstandingBean">
|
|
select
|
|
team_name as teamName,
|
|
team_type as teamType,
|
|
foreman_name as foremanName,
|
|
foreman_phone as foremanPhone,
|
|
sub_name as subName,
|
|
pro_name as proName
|
|
from
|
|
bm_outstanding_team
|
|
where
|
|
IS_ACTIVE = '1'
|
|
<if test="keyWord != null and keyWord != '' ">
|
|
and (
|
|
team_name like concat ('%',#{keyWord},'%') or
|
|
team_type like concat ('%',#{keyWord},'%') or
|
|
sub_name like concat ('%',#{keyWord},'%') or
|
|
pro_name like concat ('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
ORDER BY fraction desc
|
|
</select>
|
|
<select id="getRedListData" resultType="com.bonus.gzrn.rnama.personnel.entity.RedBean">
|
|
select
|
|
name,
|
|
phone,
|
|
post,
|
|
id_number as idNumber,
|
|
sub_name as subName,
|
|
pro_name as proName
|
|
from
|
|
bm_redlist_worker
|
|
where 1=1
|
|
<if test="keyWord != null and keyWord != '' ">
|
|
and (
|
|
name like concat ('%',#{keyWord},'%') or
|
|
post like concat ('%',#{keyWord},'%') or
|
|
sub_name like concat ('%',#{keyWord},'%') or
|
|
pro_name like concat ('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
|
|
</mapper> |