| | |
| | | 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> |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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()} |
| | |
| | | </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()} |