xuhy
3 天以前 b8cebfa38ff8cd2065431a8f18c79e480d64ff10
ruoyi-system/src/main/resources/mapper/system/TSysOrderMapper.xml
@@ -50,7 +50,7 @@
        select count(1)
        from t_sys_order tso
                 left join t_sys_order_goods tsog on tso.id = tsog.order_id
                 left join t_erp_goods teg on tepg.goods_id = teg.id
                 left join t_erp_goods teg on tsog.goods_id = teg.id
        where tso.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
          and tso.clinic_id in <foreach collection="clinicIds" open="(" separator="," item="id" close=")">#{id}</foreach>
    </select>
@@ -58,7 +58,7 @@
        select count(1)
        from t_sys_order tso
                 left join t_sys_order_goods tsog on tso.id = tsog.order_id
                 left join t_erp_goods teg on tepg.goods_id = teg.id
                 left join t_erp_goods teg on tsog.goods_id = teg.id
        where tso.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
          and tso.clinic_id in <foreach collection="clinicIds" open="(" separator="," item="id" close=")">#{id}</foreach>
        group by teg.type_id
@@ -69,7 +69,7 @@
          and pay_time between #{startTime} and #{endTime}
          and clinic_id = #{clinicId}
    </select>
    <select id="supplierSalesStatisticsGoodsType"
    <select id="clinicSalesStatisticsGoodsType"
            resultType="com.ruoyi.system.vo.ClinicSalesStatisticsGoodsTypeVO">
        select count(1), tegt.type_name
        from t_sys_order tso
@@ -82,12 +82,12 @@
        group by teg.type_id
        order by count(1) desc
    </select>
    <select id="supplierSalesStatisticsGoodsCount"
    <select id="clinicSalesStatisticsGoodsCount"
            resultType="com.ruoyi.system.vo.ClinicSalesStatisticsGoodsCountVO">
        select
        date_format(t1.pay_time, '%m.%d') as `time`,
        date_format(t1.pay_time, '%Y-%m-%d') as payTime,
        sum(t2.purchase_count) as goodsCount
        sum(t2.sale_count) as goodsCount
        from t_sys_order t1
        left join t_sys_order_goods t2 on t1.id = t2.order_id
        where t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
@@ -98,11 +98,11 @@
        </if>
        group by date_format(t1.pay_time, '%m.%d')
    </select>
    <select id="supplierSalesStatisticsGoodsCountMonth"
    <select id="clinicSalesStatisticsGoodsCountMonth"
            resultType="com.ruoyi.system.vo.ClinicSalesStatisticsGoodsCountVO">
        select
        date_format(t1.pay_time, '%Y.%m') as `time`,
        sum(t2.purchase_count) as goodsCount
        sum(t2.sale_count) as goodsCount
        from t_sys_order t1
        left join t_sys_order_goods t2 on t1.id = t2.order_id
        where t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}