Browse Source

烟草分销数据

master
lzh 2 years ago
parent
commit
d778bd37f2
  1. 16
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java

16
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java

@ -52,35 +52,35 @@ public interface GdSalesYcMapper extends BaseMapper<GdSalesYc> {
@Delete("delete from gd_sales_yc where dataDate=#{dataDate} ") @Delete("delete from gd_sales_yc where dataDate=#{dataDate} ")
void clearByDataDate(@Param("dataDate") String dataDate); void clearByDataDate(@Param("dataDate") String dataDate);
@Select("select count(1) from (select storeCode from gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate} group by storeCode) t") @Select("select count(1) from (select storeCode from gd_sales_yc where dataDate=#{dataDate} group by storeCode) t")
int countStoreOnDay(@Param("dataDate") String orderDate); int countStoreOnDay(@Param("dataDate") String orderDate);
@Select("select t2.storeCode,si.name,t2.amount from( " + @Select("select t2.storeCode,si.name,t2.amount from( " +
" select storeCode,sum(t1.price) as amount from( " + " select storeCode,sum(t1.price) as amount from( " +
" select storeCode,saleNum*salePrice as price from gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate} " + " select storeCode,saleNum*salePrice as price from gd_sales_yc where dataDate=#{dataDate} " +
" ) t1 group by t1.storeCode " + " ) t1 group by t1.storeCode " +
") t2 left join store_index si on t2.storecode=si.code ") ") t2 left join store_index si on t2.storecode=si.code ")
List<Map<String, Object>> listOfStoreOnDay(@Param("dataDate") String orderDate); List<Map<String, Object>> listOfStoreOnDay(@Param("dataDate") String orderDate);
@Select("select count(1) from (select prodCode from gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate} group by prodCode) t") @Select("select count(1) from (select prodCode from gd_sales_yc where dataDate=#{dataDate} group by prodCode) t")
int countProductOnDay(@Param("dataDate") String orderDate); int countProductOnDay(@Param("dataDate") String orderDate);
@Select("select si.name,t1.* from ( " + @Select("select si.name,t1.* from ( " +
" select storeCode,orderType,orderNo,prodCode,prodName,saleNum,salePrice,saleNum*salePrice as amount from gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate} " + " select storeCode,orderType,orderNo,prodCode,prodName,saleNum,salePrice,saleNum*salePrice as amount from gd_sales_yc where dataDate=#{dataDate} " +
") t1 left join store_index si on t1.storecode=si.code ") ") t1 left join store_index si on t1.storecode=si.code ")
List<Map<String, Object>> listOfProductOnDay(@Param("dataDate") String orderDate); List<Map<String, Object>> listOfProductOnDay(@Param("dataDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate}") @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate}")
double amountOfDay(@Param("dataDate") String orderDate); double amountOfDay(@Param("dataDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate} " + @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate} " +
" and storeCode in (select code from store_index si where si.`type`='连网连锁店') ") " and storeCode in (select code from store_index si where si.`type`='连网连锁店') ")
double amountOfLwlsdDay(@Param("dataDate") String orderDate); double amountOfLwlsdDay(@Param("dataDate") String orderDate);
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where customerName<>'客户' and customerName<>'客户1' and dataDate=#{dataDate} " + @Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate} " +
" and storeCode in (select code from store_index si where si.`type`='连锁内加盟') ") " and storeCode in (select code from store_index si where si.`type`='连锁内加盟') ")
double amountOfLsnjmDay(@Param("dataDate") String orderDate); double amountOfLsnjmDay(@Param("dataDate") String orderDate);
@Select("SELECT * FROM gd_sales_yc where orderType='批发' and (customerName='客户' or customerName='客户1') and dataDate=#{dataDate} " ) @Select("SELECT * FROM gd_sales_gd where orderType='批发' and (customerName='客户' or customerName='客户1') and dataDate=#{dataDate} " )
List<GdSalesYc> listFxOfDay(@Param("dataDate") String orderDate); List<GdSalesYc> listFxOfDay(@Param("dataDate") String orderDate);
} }

Loading…
Cancel
Save