<?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="net.lab1024.sa.admin.module.business.base.customer.dao.CustomerDao">

    <!-- 查询结果列 -->
    <sql id="base_columns">
        t_customer.customer_id,
        t_customer.customer_code,
        t_customer.customer_name,
        t_customer.person,
        t_customer.telephone,
        t_customer.address,
        t_customer.remark,
        t_customer.disabled_flag,
        t_customer.create_time,
        t_customer.create_user_id,
        t_customer.create_user_name,
        t_customer.update_time
    </sql>

    <!-- 分页查询 -->
    <select id="queryPage" resultType="net.lab1024.sa.admin.module.business.base.customer.domain.vo.CustomerVO">
        SELECT
        <include refid="base_columns"/>
        FROM t_customer
        <where>
            <!--客户-->
            <if test="queryForm.customerId != null ">
                AND t_customer.customer_id=#{queryForm.customerId}
            </if>
            <!--是否启用-->
            <if test="queryForm.disabledFlag != null">
                AND t_customer.disabled_flag=#{queryForm.disabledFlag}
            </if>
        </where>
    </select>


</mapper>
