<?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.gree.mall.manager.commonmapper.CommonMapper">
    <select id="adminCompanyPayConfigPage"
            resultType="com.gree.mall.manager.bean.admin.AdminCompanyPayConfigVO">
        SELECT
            ${ex.selected}
        FROM
            admin_company_wechat a
        ${ex.query}
        <if test="ex.orderBy == null or ex.orderBy ==''">
            ORDER BY a.create_time DESC
        </if>
        ${ex.orderBy}
    </select>

    <select id="adminCompanyPage" resultType="com.gree.mall.manager.bean.admin.AdminCompanyVO">
        SELECT
            ${ex.selected}
        FROM
            admin_company a
        ${ex.query}
    </select>

    <select id="supplementRecordList" resultType="com.gree.mall.manager.bean.ums.UmsSupplementRecordVO">
        SELECT
            ${ex.selected}
        FROM
            ums_supplement_record a
        ${ex.query}
        <if test="ex.companyIds != null and ex.companyIds.size > 0">
            and company_id in
            <foreach item="item" index="index" collection="ex.companyIds" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
            and websit_id in
            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="ex.orderBy == null or ex.orderBy ==''">
            ORDER BY a.create_time DESC
        </if>
        ${ex.orderBy}
    </select>
</mapper>