43 lines
1.7 KiB
XML
43 lines
1.7 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.ContractorMapper">
|
||
|
|
<update id="updateContractor">
|
||
|
|
update pt_cont_info
|
||
|
|
set cont_name = #{consName},
|
||
|
|
cont_address = #{consAddress},
|
||
|
|
legal_name = #{corporateName},
|
||
|
|
legal_phone = #{corporatePhone},
|
||
|
|
sup_code = #{socialUnifiedCreditCode},
|
||
|
|
update_time = now()
|
||
|
|
where cont_id = #{contId}
|
||
|
|
</update>
|
||
|
|
<delete id="deleteContractorById">
|
||
|
|
update pt_cont_info set is_active = '0' where cont_id in
|
||
|
|
<foreach item="addressId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{addressId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="listContractor" resultType="com.bonus.project.domain.ContractorBean">
|
||
|
|
select
|
||
|
|
(@rowNum := @rowNum + 1) as exportId,
|
||
|
|
pci.cont_id as contId,
|
||
|
|
pci.cont_name as consName,
|
||
|
|
pci.cont_address as consAddress,
|
||
|
|
pci.legal_name as corporateName,
|
||
|
|
pci.legal_phone as corporatePhone,
|
||
|
|
pci.sup_code as socialUnifiedCreditCode,
|
||
|
|
pci.con_usert_id as conUserId,
|
||
|
|
pci.comm_usert_name as contractorPrincipal,
|
||
|
|
pci.comm_usert_phone as contractorPrincipalPhone,
|
||
|
|
ifnull(ppc.cont_uuid,0) as status
|
||
|
|
from (select @rowNum := 0) r,pt_cont_info pci
|
||
|
|
left join (select DISTINCT cont_uuid from lk_pro_cont) ppc on pci.uuid = ppc.cont_uuid
|
||
|
|
where pci.is_active = 1
|
||
|
|
<if test="consName != null and consName != ''">
|
||
|
|
and pci.cont_name like concat('%',#{consName},'%')
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
</mapper>
|