<?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.inkasso.factoring.salesManagement.dao.CSalesContractPersonInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.inkasso.factoring.salesManagement.entity.CSalesContractPersonInfo">
        <id column="id" property="id" />
        <result column="c_sales_contract_basic_info_id" property="cSalesContractBasicInfoId" />
        <result column="name" property="name" />
        <result column="card_type" property="cardType" />
        <result column="type" property="type" />
        <result column="socialCreditCode" property="socialCreditCode" />
        <result column="mobile" property="mobile" />
        <result column="remark" property="remark" />
        <result column="user_create" property="userCreate" />
        <result column="user_modified" property="userModified" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_modified" property="gmtModified" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, c_sales_contract_basic_info_id, name, card_type, type, socialCreditCode, mobile, remark, user_create, user_modified, gmt_create, gmt_modified
    </sql>
    <select id="findSettlementAgentInfoByType"
            resultType="com.inkasso.factoring.salesManagement.entity.CSalesContractPersonInfo">
        select a.name,a.type,a.mobile from c_sales_contract_person_info a
            where a.type = #{type}
        union all
        select b.name,b.type,b.mobile from c_sales_contract_supplement_person_info b
            where b.type = #{type}
    </select>

</mapper>
