<?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.xingxi.mq.server.master.mapper.CompanyMqMapper">
    
    <resultMap type="Company" id="CompanyResult">
        <result property="companyId"    column="companyId"    />
        <result property="deptId"    column="deptId"    />
        <result property="companyName"    column="companyName"    />
        <result property="companyCode"    column="companyCode"    />
        <result property="licenseImgId"    column="licenseImgId"    />
        <result property="validBegin"    column="validBegin"    />
        <result property="validEnd"    column="validEnd"    />
        <result property="bankName"    column="bankName"    />
        <result property="bankAccount"    column="bankAccount"    />
        <result property="legalPerson"    column="legalPerson"    />
        <result property="legalNum"    column="legalNum"    />
        <result property="legalIdPortraitId"    column="legalIdPortraitId"    />
        <result property="legalIdEmblemId"    column="legalIdEmblemId"    />
        <result property="legalIdPeriodStart"    column="legalIdPeriodStart"    />
        <result property="legalIdPeriodEnd"    column="legalIdPeriodEnd"    />
        <result property="taxRate"    column="taxRate"    />
        <result property="caStatus"    column="caStatus"    />
        <result property="fclFlag"    column="fclFlag"    />
        <result property="dsptbm"    column="dsptbm"    />
        <result property="ptdj3desKey"    column="ptdj3desKey"    />
        <result property="registrationCode"    column="registrationCode"    />
        <result property="authCode"    column="authCode"    />
        <result property="folderNo"    column="folderNo"    />
        <result property="remark"    column="remark"    />
        <result property="delFlag"    column="delFlag"    />
        <result property="createUser"    column="createUser"    />
        <result property="createTime"    column="createTime"    />
        <result property="updateUser"    column="updateUser"    />
        <result property="updateTime"    column="updateTime"    />
    </resultMap>

    <sql id="selectCompany">
        select
            c.companyId,
            c.deptId,
            c.companyName,
            c.companyCode,
            c.licenseImgId,
            c.validBegin,
            c.validEnd,
            c.bankName,
            c.bankAccount,
            c.legalPerson,
            c.legalNum,
            c.legalIdPortraitId,
            c.legalIdEmblemId,
            c.legalIdPeriodStart,
            c.legalIdPeriodEnd,
            c.taxRate,
            c.caStatus,
            c.fclFlag,
            c.dsptbm,
            c.ptdj3desKey,
            c.registrationCode,
            c.authCode,
            c.folderNo,
            c.remark,
            c.delFlag,
            c.createUser,
            c.createTime,
            c.updateUser,
            c.updateTime
        from m_company c
    </sql>

    <select id="selectCompanyByCompanyCode" parameterType="String" resultMap="CompanyResult">
        <include refid="selectCompany"/>
        where c.delFlag = '0' and c.companyCode = #{companyCode}
        limit 1
    </select>

</mapper>