xiaoyong931011
2023-02-15 c7f2e2515670435dcba254f7cc5738fafeb9fab2
src/main/resources/mapper/modules/MallSalesmanMapper.xml
@@ -27,7 +27,6 @@
    </select>
    <select id="selectAddressAmountListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallAddressInfoVo">
        SELECT
            a.province,
            a.city
@@ -96,6 +95,59 @@
        a.province
        FROM mall_address_info a
        group by a.province
</select>
    </select>
    <select id="selectSalesmanAchieveListInPage" resultType="cc.mrbird.febs.mall.vo.AdminSalesmanAchieveVo">
        SELECT
        a.province,
        a.city,
        a.name salesmanName,
        a.id salesmanId,
        (select count(b.id) from mall_member b where b.salesmans_id = a.id) memberCnt
        FROM mall_salesman a
        <where>
            <if test="record != null" >
                <if test="record.province != null and record.province != ''">
                    and a.province = #{record.province}
                </if>
                <if test="record.city != null and record.city != ''">
                    and a.city = #{record.city}
                </if>
            </if>
        </where>
        ORDER BY
        memberCnt DESC, a.province ASC
    </select>
    <select id="selectSalesmanAchieveProvince" resultType="cc.mrbird.febs.mall.vo.AdminSalesmanAchieveVo">
        SELECT
            a.province
        FROM mall_salesman a
        group by a.province
    </select>
    <select id="selectAdminMemberOrderVoBySalesmanId" resultType="cc.mrbird.febs.mall.vo.AdminMemberOrderVo">
        select
            c.name memberName,
            c.phone memberPhone,
            a.address memberAddress,
            a.id orderId,
            a.order_no orderNo,
            a.CREATED_TIME createdTime,
            a.amount orderAmount
        from
            mall_order_info a
        left join mall_member c on a.member_id = c.id
        where
            a.status in (2, 3, 4)
            and  a.order_type = 1
            and  a.member_id in (
                select
                    b.id
                from mall_member b
                where
                    b.salesmans_id = #{salesmanId}
            )
    </select>
</mapper>