nxdt-system/bonus-modules/bonus-project/src/main/resources/mapper/system/ContractorMapper.xml

51 lines
2.0 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>
<update id="deleteUserId">
update sys_user set del_flag = '2' where user_id=#{userId}
</update>
<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>
<select id="getUserIdByContractId" resultType="java.lang.String">
select pci.con_usert_id
from pt_cont_info pci
where cont_id=#{contId}
</select>
</mapper>