<?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="cn.superdesk.uniorder.dao.mapper.unified.settlement.UnifiedSettlementProgrammeMapperEx">

    <select id="list"
            resultType="cn.superdesk.uniorder.dto.vo.operationCenter.customer.settlement.UnifiedSettlementVo">

        SELECT
            t.id ,
            t.programme_name programmeName,
            t.programme_no programmeNo,
            t.settlement_rule settlementRule,
            t.remark,
            t.enabled,
            t.is_default isDefault,
            t1.fullname updateUser,
            t.update_time updateTime
        FROM unified_settlement_programme t
                 LEFT JOIN
             sys_user t1
             on t.update_user_id= t1.id
        WHERE
            t.deleted=0
        <if test="status !=null ">
            and t.enabled=#{status}
        </if>
        <if test="programmeName !=null and programmeName !=''">
            and t.programme_name=#{programmeName}
        </if>
        <if test="programmeNo !=null and programmeNo !=''">
            and t.programme_no=#{programmeNo}
        </if>
        <if test="customerId !=null and customerId !=''">
            and t.customer_id =#{customerId}
        </if>


        ORDER BY t.update_time desc

    </select>
</mapper>