<?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.usky.fire.mapper.BaseCompanyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.usky.fire.domain.BaseCompany">
        <id column="id" property="id" />
        <result column="company_id" property="companyId" />
        <result column="company_code" property="companyCode" />
        <result column="organization" property="organization" />
        <result column="company_name" property="companyName" />
        <result column="name_abbreviation" property="nameAbbreviation" />
        <result column="company_type" property="companyType" />
        <result column="address" property="address" />
        <result column="fire_hazard" property="fireHazard" />
        <result column="postal_code" property="postalCode" />
        <result column="mailbox" property="mailbox" />
        <result column="link_person" property="linkPerson" />
        <result column="link_phone" property="linkPhone" />
        <result column="company_fax" property="companyFax" />
        <result column="economic_ownership" property="economicOwnership" />
        <result column="found_time" property="foundTime" />
        <result column="upper_name" property="upperName" />
        <result column="company_grade" property="companyGrade" />
        <result column="company_nature" property="companyNature" />
        <result column="administrative_division" property="administrativeDivision" />
        <result column="division_name" property="divisionName" />
        <result column="fire_jurisdiction" property="fireJurisdiction" />
        <result column="detachment_id" property="detachmentId" />
        <result column="street_town" property="streetTown" />
        <result column="enable" property="enable" />
        <result column="creator_name" property="creatorName" />
        <result column="creator" property="creator" />
        <result column="create_time" property="createTime" />
        <result column="update_person_name" property="updatePersonName" />
        <result column="update_person_ip" property="updatePersonIp" />
        <result column="update_person" property="updatePerson" />
        <result column="update_time" property="updateTime" />
    </resultMap>
    <select id="companyNameList" resultType="com.usky.fire.domain.BaseCompany">
        SELECT
        *
        FROM
        base_company
        <where>
            <if test="companyIdList != null and companyIdList != ''">
                company_id in
                <foreach collection="companyIdList" item="companyId" index="index" open="(" close=")" separator=",">
                   #{companyId}
                </foreach>
            </if>
        </where>
    </select>
</mapper>
