134 lines
5.2 KiB
XML
134 lines
5.2 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.project.mapper.SubEntryExitMapper">
|
||
|
|
<update id="subOutApply">
|
||
|
|
update lk_cont_sub
|
||
|
|
set out_status = #{status},
|
||
|
|
departure_date= #{departureDate},
|
||
|
|
exit_reason = #{reason}
|
||
|
|
where uuid = #{uuid}
|
||
|
|
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="listSubEntry" resultType="com.bonus.project.domain.SubEntryExit">
|
||
|
|
SELECT
|
||
|
|
(@rowNum := @rowNum + 1) as exportId,
|
||
|
|
psi.sub_id as id,
|
||
|
|
lcs.pro_id as proId,
|
||
|
|
lcs.cont_uuid as consUuid,
|
||
|
|
lcs.sup_uuid as supUuid,
|
||
|
|
lcs.sub_uuid as subUuid,
|
||
|
|
lcs.uuid as uuid,
|
||
|
|
lcs.cont_uuid as contUuid,
|
||
|
|
ppi.pro_name as proName,
|
||
|
|
pci.cont_name as contName,
|
||
|
|
psi.sub_name as subName,
|
||
|
|
psi.sub_code as subCode,
|
||
|
|
psi.legal_name as legalName,
|
||
|
|
psi.legal_phone as legalPhone,
|
||
|
|
psi.sub_user_name as subUserName,
|
||
|
|
psi.sub_user_phone as subUserPhone,
|
||
|
|
lcs.task_id as taskId,
|
||
|
|
lcs.proc_inst_id as procInsId,
|
||
|
|
'0' as status,
|
||
|
|
lcs.into_status as intoStatus
|
||
|
|
FROM
|
||
|
|
(select @rowNum := 0) r,lk_cont_sub lcs
|
||
|
|
LEFT JOIN pt_sub_info psi ON lcs.sub_uuid = psi.uuid AND psi.is_active = '1'
|
||
|
|
LEFT JOIN pt_project_info ppi ON lcs.pro_id = ppi.pro_id AND ppi.is_active = '1'
|
||
|
|
LEFT JOIN pt_cont_info pci ON lcs.cont_uuid = pci.uuid AND pci.is_active = '1'
|
||
|
|
WHERE
|
||
|
|
lcs.out_status = '0' AND lcs.into_status != '0' and psi.sub_id is not null
|
||
|
|
<if test="userType != 00 or userType != 00">
|
||
|
|
AND lcs.pro_id = #{proId}
|
||
|
|
</if>
|
||
|
|
<if test="userType == '02' or userType == 02">
|
||
|
|
AND lcs.cont_uuid = #{contUuid}
|
||
|
|
</if>
|
||
|
|
<if test="userType == '01' or userType == 01">
|
||
|
|
AND lcs.sup_uuid = #{supUuid}
|
||
|
|
</if>
|
||
|
|
<if test="status != null and status != '' and status != 1 and status != '1' and status != '2' and status != 2 ">
|
||
|
|
AND lcs.into_status = #{status}
|
||
|
|
</if>
|
||
|
|
<if test="keyWord != null and keyWord != ''">
|
||
|
|
AND (
|
||
|
|
psi.sub_code LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.legal_name LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.legal_phone LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.sub_user_name LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.sub_user_phone LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="contName != null and contName != ''">
|
||
|
|
AND pci.cont_id = #{contName}
|
||
|
|
</if>
|
||
|
|
<if test="subName != null and subName != ''">
|
||
|
|
AND psi.sub_id = #{subName}
|
||
|
|
</if>
|
||
|
|
<if test="appType == 'app'">
|
||
|
|
AND lcs.pro_id = #{proId}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="listSubExit" resultType="com.bonus.project.domain.SubEntryExit">
|
||
|
|
SELECT
|
||
|
|
(@rowNum := @rowNum + 1) as exportId,
|
||
|
|
lcs.pro_id as proId,
|
||
|
|
lcs.cont_uuid as consUuid,
|
||
|
|
lcs.sup_uuid as supUuid,
|
||
|
|
lcs.sub_uuid as subUuid,
|
||
|
|
lcs.uuid as uuid,
|
||
|
|
lcs.task_id_out as taskId,
|
||
|
|
lcs.proc_inst_id_out as procInsId,
|
||
|
|
lcs.cont_uuid as contUuid,
|
||
|
|
ppi.pro_name as proName,
|
||
|
|
pci.cont_name as contName,
|
||
|
|
psi.sub_name as subName,
|
||
|
|
psi.sub_code as subCode,
|
||
|
|
psi.legal_name as legalName,
|
||
|
|
psi.legal_phone as legalPhone,
|
||
|
|
psi.sub_user_name as subUserName,
|
||
|
|
psi.sub_user_phone as subUserPhone,
|
||
|
|
lcs.out_status as intoStatus,
|
||
|
|
'0' as status
|
||
|
|
FROM
|
||
|
|
(select @rowNum := 0) r,lk_cont_sub lcs
|
||
|
|
LEFT JOIN pt_sub_info psi ON lcs.sub_uuid = psi.uuid AND psi.is_active = '1'
|
||
|
|
LEFT JOIN pt_project_info ppi ON lcs.pro_id = ppi.pro_id AND ppi.is_active = '1'
|
||
|
|
LEFT JOIN pt_cont_info pci ON lcs.cont_uuid = pci.uuid AND pci.is_active = '1'
|
||
|
|
WHERE
|
||
|
|
lcs.out_status != '0' AND lcs.into_status = '3'
|
||
|
|
<if test="userType != 00 or userType != 00">
|
||
|
|
AND lcs.pro_id = #{proId}
|
||
|
|
</if>
|
||
|
|
<if test="userType == '02' or userType == 02">
|
||
|
|
AND lcs.cont_uuid = #{contUuid}
|
||
|
|
</if>
|
||
|
|
<if test="userType == '01' or userType == 01">
|
||
|
|
AND lcs.sup_uuid = #{supUuid}
|
||
|
|
</if>
|
||
|
|
<if test="status != null and status != '' and status != 1 and status != '1' and status != '2' and status != 2 ">
|
||
|
|
AND lcs.out_status = #{status}
|
||
|
|
</if>
|
||
|
|
<if test="keyWord != null and keyWord != ''">
|
||
|
|
AND (
|
||
|
|
psi.sub_code LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.legal_name LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.legal_phone LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.sub_user_name LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
OR psi.sub_user_phone LIKE CONCAT('%',#{keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="contName != null and contName != ''">
|
||
|
|
AND pci.cont_id = #{contName}
|
||
|
|
</if>
|
||
|
|
<if test="subName != null and subName != ''">
|
||
|
|
AND psi.sub_id = #{subName}
|
||
|
|
</if>
|
||
|
|
<if test="appType == 'app'">
|
||
|
|
AND lcs.pro_id = #{proId}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
</mapper>
|