111 lines
4.1 KiB
XML
111 lines
4.1 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.hnrn.rnama.person.dao.ClientManageDao">
|
|
<insert id="uploadClientData">
|
|
insert into bns_smz_bm_sub_principal_management(
|
|
<if test="proId!=null and proId!=''">
|
|
PRO_ID,
|
|
</if>
|
|
<if test="subId!=null and subId!=''">
|
|
SUB_ID,
|
|
</if>
|
|
<if test="clientName!=null and clientName!=''">
|
|
NAME,
|
|
</if>
|
|
<if test="frontPath!=null and frontPath!=''">
|
|
ID_CARD_JUST_URL,
|
|
</if>
|
|
<if test="backPath!=null and backPath!=''">
|
|
ID_CARD_BACK_URL,
|
|
</if>
|
|
<if test="videoPath!=null and videoPath!=''">
|
|
OPERATION_VIDEO_URL,
|
|
</if>
|
|
<if test="aotoPath!=null and aotoPath!=''">
|
|
E_SIGNATURE_URL,
|
|
</if>
|
|
<if test="clientFilePath!=null and clientFilePath!=''">
|
|
POWER_OF_ATTORNEY_URL,
|
|
</if>
|
|
CRATE_TIME,
|
|
UPDATE_TIME
|
|
)
|
|
values (
|
|
<if test="proId!=null and proId!=''">
|
|
#{proId},
|
|
</if>
|
|
<if test="subId!=null and subId!=''">
|
|
#{subId},
|
|
</if>
|
|
<if test="clientName!=null and clientName!=''">
|
|
#{clientName},
|
|
</if>
|
|
<if test="frontPath!=null and frontPath!=''">
|
|
#{frontPath},
|
|
</if>
|
|
<if test="backPath!=null and backPath!=''">
|
|
#{backPath},
|
|
</if>
|
|
<if test="videoPath!=null and videoPath!=''">
|
|
#{videoPath},
|
|
</if>
|
|
<if test="aotoPath!=null and aotoPath!=''">
|
|
#{aotoPath},
|
|
</if>
|
|
<if test="clientFilePath!=null and clientFilePath!=''">
|
|
#{clientFilePath},
|
|
</if>
|
|
NOW(),
|
|
NOW()
|
|
)
|
|
</insert>
|
|
<update id="delClientData">
|
|
update bns_smz_bm_sub_principal_management
|
|
set IS_ACTIVE='0'
|
|
where PRO_ID = #{proId}
|
|
and SUB_ID = #{subId}
|
|
and IS_ACTIVE = '1'
|
|
</update>
|
|
|
|
<select id="getClientManageData" resultType="com.bonus.hnrn.rnama.person.entity.ClientManageBean">
|
|
SELECT sub.ID AS subId,
|
|
sub.SUB_NAME AS subName,
|
|
p.id AS proId,
|
|
p.`name` AS proName,
|
|
p.UPDATE_TIME AS updateTime,
|
|
bspm.ID AS clientId,
|
|
bspm.`NAME` AS clientName,
|
|
bspm.AUDIT_RESULT AS clientState
|
|
FROM bns_smz_bm_project p
|
|
LEFT JOIN bns_smz_bm_sub_pro_relation bspr ON bspr.pro_id = p.id
|
|
LEFT JOIN bns_smz_bm_sub_principal_management bspm ON bspm.PRO_ID = p.ID
|
|
AND bspr.sub_id = bspm.SUB_ID
|
|
AND bspm.IS_ACTIVE = '1'
|
|
LEFT JOIN bns_smz_bm_subcontractor sub ON sub.ID = bspr.sub_id
|
|
AND sub.IS_ACTIVE = '1'
|
|
WHERE bspr.sub_id = #{subId}
|
|
AND p.STATUS = '在建'
|
|
AND p.update_time >= '2028-01-01 00:00:00'
|
|
AND p.is_active = 1
|
|
</select>
|
|
<select id="getProClientState" resultType="com.bonus.hnrn.rnama.person.entity.ClientManageBean">
|
|
SELECT sub.ID AS subId,
|
|
sub.SUB_NAME AS subName,
|
|
p.id AS proId,
|
|
p.`name` AS proName,
|
|
p.UPDATE_TIME AS updateTime,
|
|
bspm.ID AS clientId,
|
|
bspm.`NAME` AS clientName,
|
|
bspm.AUDIT_RESULT AS clientState
|
|
FROM bns_smz_bm_project p
|
|
LEFT JOIN bns_smz_bm_sub_pro_relation bspr ON bspr.pro_id = p.id
|
|
LEFT JOIN bns_smz_bm_sub_principal_management bspm ON bspm.PRO_ID = p.ID
|
|
AND bspr.sub_id = bspm.SUB_ID
|
|
AND bspm.IS_ACTIVE = '1'
|
|
LEFT JOIN bns_smz_bm_subcontractor sub ON sub.ID = bspr.sub_id
|
|
AND sub.IS_ACTIVE = '1'
|
|
WHERE bspr.sub_id = #{subId}
|
|
and p.id=#{proId}
|
|
AND p.is_active = 1
|
|
</select>
|
|
</mapper> |