<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceCompanyMapper">

    <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany">
            <id property="id" column="ID" jdbcType="VARCHAR"/>
            <result property="companyName" column="COMPANY_NAME" jdbcType="VARCHAR"/>
            <result property="companyAddress" column="COMPANY_ADDRESS" jdbcType="VARCHAR"/>
            <result property="companyDocking" column="COMPANY_DOCKING" jdbcType="VARCHAR"/>
            <result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
            <result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
            <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
            <result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
            <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
            <result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
            <result property="billingType" column="BILLING_TYPE" jdbcType="TINYINT"/>
			<result property="insuranceHandleProvince" column="INSURANCE_HANDLE_PROVINCE" jdbcType="TINYINT"/>
			<result property="insuranceHandleProvinceName" column="INSURANCE_HANDLE_PROVINCE_NAME" jdbcType="VARCHAR"/>
			<result property="insuranceHandleCity" column="INSURANCE_HANDLE_CITY" jdbcType="TINYINT"/>
			<result property="insuranceHandleCityName" column="INSURANCE_HANDLE_CITY_NAME" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        ID,COMPANY_NAME,COMPANY_ADDRESS,
        COMPANY_DOCKING,CREATE_BY,CREATE_NAME,
        CREATE_TIME,UPDATE_BY,UPDATE_TIME,
        DELETE_FLAG,BILLING_TYPE,
		INSURANCE_HANDLE_PROVINCE,INSURANCE_HANDLE_PROVINCE_NAME,INSURANCE_HANDLE_CITY,INSURANCE_HANDLE_CITY_NAME
    </sql>
	<select id="getInsuranceCompanyListPage" resultMap="BaseResultMap">
		SELECT
		<include refid="Base_Column_List"></include>
		FROM t_insurance_company
		where DELETE_FLAG = 0
		<if test="param.companyName != null and param.companyName.trim() != ''">
			and COMPANY_NAME like concat('%', #{param.companyName}, '%')
		</if>
		<if test="param.insuranceHandleCity != null">
			and INSURANCE_HANDLE_CITY = #{param.insuranceHandleCity}
		</if>
		ORDER BY CREATE_TIME DESC
	</select>
</mapper>
