<?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.ruoyi.mall.mapper.AftersaleMapper">


    <sql id="selectAftersaleVo">
        select id, member_id, order_id, return_amount, type, status, handle_time, quantity, reason, description, proof_pics, handle_note, handle_man, create_by, create_time, update_by, update_time   from oms_aftersale
    </sql>

    <select id="statPendingAndProcessing" resultType="OrderAndAftersaleStatisticsVO">
        select
            IFNULL(sum(case when status=0 then 1 else 0 end), 0) pendingAftersaleCount,
            IFNULL(sum(case when status=1 then 1 else 0 end), 0) processingAftersaleCount
        from oms_aftersale
    </select>

</mapper>
