综合销售表 调整, 同步调整
This commit is contained in:
@@ -60,7 +60,20 @@ public class NewGrBiSaAggMonthCountController extends BaseController
|
|||||||
Map<String, Object> params = FuncWeb.getParameterBodyMap(req);
|
Map<String, Object> params = FuncWeb.getParameterBodyMap(req);
|
||||||
String groupField = params.containsKey("Group by") ? params.get("Group by").toString() : "";
|
String groupField = params.containsKey("Group by") ? params.get("Group by").toString() : "";
|
||||||
SaAggParam saAggParam = new SaAggParam();
|
SaAggParam saAggParam = new SaAggParam();
|
||||||
if(groupField.contains("useMonth")){
|
if(groupField.contains("useYear") && !groupField.contains("useMonth")){
|
||||||
|
if(params.containsKey("useYearStart")){
|
||||||
|
saAggParam.setUseYearStart(params.get("useYearStart").toString());
|
||||||
|
}
|
||||||
|
if(params.containsKey("useYearEnd")){
|
||||||
|
saAggParam.setUseYearEnd(params.get("useYearEnd").toString());
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(params.containsKey("useYearStart")){
|
||||||
|
saAggParam.setUseYearStart(params.get("useYearStart").toString());
|
||||||
|
}
|
||||||
|
if(params.containsKey("useYearEnd")){
|
||||||
|
saAggParam.setUseYearEnd(params.get("useYearEnd").toString());
|
||||||
|
}
|
||||||
if (params.containsKey("useMonthStart")){
|
if (params.containsKey("useMonthStart")){
|
||||||
saAggParam.setUseMonthStart(params.get("useMonthStart").toString());
|
saAggParam.setUseMonthStart(params.get("useMonthStart").toString());
|
||||||
}
|
}
|
||||||
@@ -68,12 +81,7 @@ public class NewGrBiSaAggMonthCountController extends BaseController
|
|||||||
saAggParam.setUseMonthEnd(params.get("useMonthEnd").toString());
|
saAggParam.setUseMonthEnd(params.get("useMonthEnd").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(params.containsKey("useYearStart")){
|
|
||||||
saAggParam.setUseYearStart(params.get("useYearStart").toString());
|
|
||||||
}
|
|
||||||
if(params.containsKey("useYearEnd")){
|
|
||||||
saAggParam.setUseYearEnd(params.get("useYearEnd").toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(params.containsKey("customName")){
|
if(params.containsKey("customName")){
|
||||||
saAggParam.setCustomName(Arrays.asList(params.get("customName").toString().split(",")));
|
saAggParam.setCustomName(Arrays.asList(params.get("customName").toString().split(",")));
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ public class zhxsqkPlugin implements ReportAroundAdvicePlugin {
|
|||||||
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
||||||
if(!groupFieldList.contains("useMonth") && !groupFieldList.contains("useYear")){
|
if(!groupFieldList.contains("useMonth") && !groupFieldList.contains("useYear")){
|
||||||
setMonthOrderBy(params, page);
|
setMonthOrderBy(params, page);
|
||||||
|
if(params.get("useYearStart").toString() .equals(params.get("useYearEnd").toString())){
|
||||||
|
params.put("isOneYear", true);
|
||||||
|
}else{
|
||||||
|
params.put("isOneYear", false);
|
||||||
|
}
|
||||||
List<NewGrBiSaAggMonthCount> newGrBiSaAggList = newGrBiSaAggMonthCountService.selectNewGrBiSaAggGroupNoMonthNoYearList(params, groupFieldList);
|
List<NewGrBiSaAggMonthCount> newGrBiSaAggList = newGrBiSaAggMonthCountService.selectNewGrBiSaAggGroupNoMonthNoYearList(params, groupFieldList);
|
||||||
PageInfo<NewGrBiSaAggMonthCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
PageInfo<NewGrBiSaAggMonthCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
||||||
List<Map<String, Object>> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList());
|
List<Map<String, Object>> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -153,9 +153,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
saler.SALERID AS saler_id,
|
saler.SALERID AS saler_id,
|
||||||
saler.SALERNAME AS saler_name,
|
saler.SALERNAME AS saler_name,
|
||||||
sum(SAQTY) AS this_month_sa_qty,
|
sum(SAQTY) AS this_month_sa_qty,
|
||||||
round(sum(SAMONEYTX), 2) AS this_month_sa_money,
|
round(sum(SAMONEY), 2) AS this_month_sa_money, --除税销售额
|
||||||
round(sum(COST), 2) AS this_month_cost,
|
round(sum(COST), 2) AS this_month_cost,
|
||||||
round(sum(PROFIT), 2) AS this_month_profit
|
round(sum(PROFIT), 2) AS this_month_profit
|
||||||
|
-- sum(SAQTY) as 本月销量,
|
||||||
|
-- round(SUM(SAMONEY), 2) 除税销售额,
|
||||||
|
-- round(sum(SAMONEYTX), 2) 含税销售额,
|
||||||
|
-- round(sum(COST), 2) 销售成本,
|
||||||
|
-- round(sum(PROFIT), 2) 毛利额
|
||||||
FROM
|
FROM
|
||||||
GR_BI_SA_SETDTL AS a
|
GR_BI_SA_SETDTL AS a
|
||||||
LEFT JOIN erp_bi_data.GR_BI_PUB_GOODS AS goods ON a.goodsid = goods.goodsid
|
LEFT JOIN erp_bi_data.GR_BI_PUB_GOODS AS goods ON a.goodsid = goods.goodsid
|
||||||
|
|||||||
@@ -264,62 +264,113 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectNewGrBiSaAggGroupNoMonthNoYearList" resultMap="NewGrBiSaAggMonthCountResult">
|
<select id="selectNewGrBiSaAggGroupNoMonthNoYearList" resultMap="NewGrBiSaAggMonthCountResult">
|
||||||
select
|
select
|
||||||
CONCAT (#{params.useYearMonthStart} , '~' , #{params.useYearMonthEnd}) as ny,
|
<trim suffixOverrides=",">
|
||||||
#{saAggParam.useYearStart} as useYearStart,
|
CONCAT (#{params.useYearMonthStart} , '~' , #{params.useYearMonthEnd}) as ny,
|
||||||
#{saAggParam.useYearEnd} as useYearEnd,
|
#{saAggParam.useYearStart} as useYearStart,
|
||||||
#{saAggParam.useMonthStart} as useMonthStart,
|
#{saAggParam.useYearEnd} as useYearEnd,
|
||||||
#{saAggParam.useMonthEnd} as useMonthEnd,
|
#{saAggParam.useMonthStart} as useMonthStart,
|
||||||
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
#{saAggParam.useMonthEnd} as useMonthEnd,
|
||||||
current_month.custom_id,
|
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
||||||
current_month.custom_name,
|
current_month.custom_id,
|
||||||
</if>
|
current_month.custom_name,
|
||||||
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
</if>
|
||||||
current_month.zone_id,
|
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
||||||
current_month.zone_name,
|
current_month.zone_id,
|
||||||
</if>
|
current_month.zone_name,
|
||||||
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
</if>
|
||||||
current_month.sale_type_id,
|
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
||||||
current_month.sale_type_name,
|
current_month.sale_type_id,
|
||||||
</if>
|
current_month.sale_type_name,
|
||||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
</if>
|
||||||
current_month.saler_id,
|
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||||
current_month.saler_name,
|
current_month.saler_id,
|
||||||
</if>
|
current_month.saler_name,
|
||||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
</if>
|
||||||
current_month.dosage_id,
|
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||||
current_month.dosage_name,
|
current_month.dosage_id,
|
||||||
</if>
|
current_month.dosage_name,
|
||||||
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
</if>
|
||||||
current_month.std_goods_name,
|
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
||||||
</if>
|
current_month.std_goods_name,
|
||||||
current_month.this_month_sa_qty AS this_month_sa_qty,
|
</if>
|
||||||
ROUND(current_month.this_month_sa_money / 10000, 2) AS this_month_sa_money,
|
current_month.this_month_sa_qty AS this_month_sa_qty,
|
||||||
ROUND(current_month.this_month_profit / 10000, 2) AS this_month_profit,
|
ROUND(current_month.this_month_sa_money / 10000, 2) AS this_month_sa_money,
|
||||||
ROUND(current_month.this_month_cost / 10000, 2) AS this_month_cost,
|
ROUND(current_month.this_month_profit / 10000, 2) AS this_month_profit,
|
||||||
COALESCE (ROUND( current_month.this_month_sa_money/total_month_data.this_month_sa_money_sum * 100, 2), 0 ) as this_month_sa_money_share,
|
ROUND(current_month.this_month_cost / 10000, 2) AS this_month_cost,
|
||||||
COALESCE (ROUND( current_month.this_month_profit/total_month_data.this_month_profit_sum * 100, 2), 0 ) as this_month_profit_share
|
COALESCE (ROUND( current_month.this_month_sa_money/total_month_data.this_month_sa_money_sum * 100, 2), 0 ) as this_month_sa_money_share,
|
||||||
FROM ( SELECT
|
COALESCE (ROUND( current_month.this_month_profit/total_month_data.this_month_profit_sum * 100, 2), 0 ) as this_month_profit_share,
|
||||||
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
|
||||||
custom_id,
|
|
||||||
custom_name ,
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
<if test="params.isOneYear" >
|
||||||
std_goods_name,
|
ROUND(yoy_month.yoy_month_sa_qty / 10000, 2) AS yoy_month_sa_qty,
|
||||||
</if>
|
ROUND(yoy_month.yoy_month_sa_money / 10000, 2) AS yoy_month_sa_money,
|
||||||
|
ROUND(yoy_month.yoy_month_profit / 10000, 2) AS yoy_month_profit,
|
||||||
|
ROUND(yoy_month.yoy_month_cost / 10000, 2) AS yoy_month_cost,
|
||||||
|
CASE WHEN (CASE WHEN yoy_month.yoy_month_sa_qty = 0 THEN IF(current_month.this_month_sa_qty > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END) > 0 THEN
|
||||||
|
CONCAT('🟢 ', ROUND((CASE WHEN yoy_month.yoy_month_sa_qty = 0 THEN IF(current_month.this_month_sa_qty > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END), 2))
|
||||||
|
WHEN (CASE WHEN yoy_month.yoy_month_sa_qty = 0 THEN IF(current_month.this_month_sa_qty > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END)<0 THEN
|
||||||
|
CONCAT('🔴 ', ROUND((CASE WHEN yoy_month.yoy_month_sa_qty = 0 THEN IF(current_month.this_month_sa_qty > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END), 2))
|
||||||
|
END AS monthsaqty_yoy,
|
||||||
|
|
||||||
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
CASE WHEN (CASE WHEN yoy_month.yoy_month_sa_money = 0 THEN IF(current_month.this_month_sa_money > 0, 100, 0)
|
||||||
zone_id,
|
ELSE (current_month.this_month_sa_money - yoy_month.yoy_month_sa_money) / yoy_month.yoy_month_sa_money * 100 END) > 0 THEN
|
||||||
zone_name,
|
CONCAT('🟢 ', ROUND((CASE WHEN yoy_month.yoy_month_sa_money = 0 THEN IF(current_month.this_month_sa_money > 0, 100, 0)
|
||||||
</if>
|
ELSE (current_month.this_month_sa_money - yoy_month.yoy_month_sa_money) / yoy_month.yoy_month_sa_money * 100 END), 2))
|
||||||
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
WHEN (CASE WHEN yoy_month.yoy_month_sa_money = 0 THEN IF(current_month.this_month_sa_money > 0, 100, 0)
|
||||||
sale_type_id,
|
ELSE (current_month.this_month_sa_money - yoy_month.yoy_month_sa_money) / yoy_month.yoy_month_sa_money * 100 END)<0 THEN
|
||||||
sale_type_name,
|
CONCAT('🔴 ', ROUND((CASE WHEN yoy_month.yoy_month_sa_money = 0 THEN IF(current_month.this_month_sa_money > 0, 100, 0)
|
||||||
</if>
|
ELSE (current_month.this_month_sa_money - yoy_month.yoy_month_sa_money) / yoy_month.yoy_month_sa_money * 100 END), 2))
|
||||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
ELSE '0.00'
|
||||||
dosage_id,
|
END AS monthsamoney_yoy,
|
||||||
dosage_name,
|
|
||||||
</if>
|
CASE WHEN (CASE WHEN yoy_month.yoy_month_cost = 0 THEN IF(current_month.this_month_cost > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_cost - yoy_month.yoy_month_cost) / yoy_month.yoy_month_cost * 100 END) > 0 THEN
|
||||||
|
CONCAT('🟢 ', ROUND((CASE WHEN yoy_month.yoy_month_cost = 0 THEN IF(current_month.this_month_cost > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_cost - yoy_month.yoy_month_cost) / yoy_month.yoy_month_cost * 100 END), 2))
|
||||||
|
WHEN (CASE WHEN yoy_month.yoy_month_cost = 0 THEN IF(current_month.this_month_cost > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_cost - yoy_month.yoy_month_cost) / yoy_month.yoy_month_cost * 100 END)<0 THEN
|
||||||
|
CONCAT('🔴 ', ROUND((CASE WHEN yoy_month.yoy_month_cost = 0 THEN IF(current_month.this_month_cost > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_cost - yoy_month.yoy_month_cost) / yoy_month.yoy_month_cost * 100 END), 2))
|
||||||
|
ELSE '0.00'
|
||||||
|
END AS this_month_cost_yoy,
|
||||||
|
|
||||||
|
CASE WHEN (CASE WHEN yoy_month.yoy_month_profit = 0 THEN IF(current_month.this_month_profit > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_profit - yoy_month.yoy_month_profit) / yoy_month.yoy_month_profit * 100 END) > 0 THEN
|
||||||
|
CONCAT('🟢 ', ROUND((CASE WHEN yoy_month.yoy_month_profit = 0 THEN IF(current_month.this_month_profit > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_profit - yoy_month.yoy_month_profit) / yoy_month.yoy_month_profit * 100 END), 2))
|
||||||
|
WHEN (CASE WHEN yoy_month.yoy_month_profit = 0 THEN IF(current_month.this_month_profit > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_profit - yoy_month.yoy_month_profit) / yoy_month.yoy_month_profit * 100 END)<0 THEN
|
||||||
|
CONCAT('🔴 ', ROUND((CASE WHEN yoy_month.yoy_month_profit = 0 THEN IF(current_month.this_month_profit > 0, 100, 0)
|
||||||
|
ELSE (current_month.this_month_profit - yoy_month.yoy_month_profit) / yoy_month.yoy_month_profit * 100 END), 2))
|
||||||
|
ELSE '0.00'
|
||||||
|
END AS monthprofit_yoy,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
FROM ( SELECT
|
||||||
|
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
||||||
|
custom_id,
|
||||||
|
custom_name ,
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
||||||
|
std_goods_name,
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
||||||
|
zone_id,
|
||||||
|
zone_name,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
||||||
|
sale_type_id,
|
||||||
|
sale_type_name,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||||
|
dosage_id,
|
||||||
|
dosage_name,
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||||
saler_id,
|
saler_id,
|
||||||
@@ -403,6 +454,121 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
) AS current_month
|
) AS current_month
|
||||||
|
<if test="params.isOneYear" >
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
||||||
|
custom_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
||||||
|
std_goods_name,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
||||||
|
zone_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
||||||
|
sale_type_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||||
|
dosage_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||||
|
saler_id,
|
||||||
|
</if>
|
||||||
|
ifnull(SUM(this_month_sa_qty), 0) AS yoy_month_sa_qty,
|
||||||
|
ifnull(SUM(this_month_sa_money), 0) AS yoy_month_sa_money,
|
||||||
|
ifnull(SUM(this_month_cost), 0) as yoy_month_cost,
|
||||||
|
ifnull(SUM(this_month_profit), 0) AS yoy_month_profit
|
||||||
|
FROM new_gr_bi_sa_agg_month_count
|
||||||
|
<where>
|
||||||
|
((use_year+1) * 100 + use_month) >= (#{saAggParam.useYearStart} * 100 + #{saAggParam.useMonthStart})
|
||||||
|
AND ((use_year+1) * 100 + use_month) <= (#{saAggParam.useYearEnd} * 100 + #{saAggParam.useMonthEnd})
|
||||||
|
<if test="saAggParam.zoneName != null and saAggParam.zoneName != ''"> and zone_name in
|
||||||
|
<foreach collection="saAggParam.zoneName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="saAggParam.saleTypeName != null and saAggParam.saleTypeName != ''"> and sale_type_name in
|
||||||
|
<foreach collection="saAggParam.saleTypeName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="saAggParam.customName != null and saAggParam.customName != ''"> and custom_name in
|
||||||
|
<foreach collection="saAggParam.customName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="saAggParam.dosageName != null and saAggParam.dosageName != ''"> and dosage_name in
|
||||||
|
<foreach collection="saAggParam.dosageName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="saAggParam.goodsName != null and saAggParam.goodsName != ''"> and goods_name in
|
||||||
|
<foreach collection="saAggParam.goodsName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="saAggParam.provinceName != null and saAggParam.provinceName != ''"> and province_name in
|
||||||
|
<foreach collection="saAggParam.provinceName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="saAggParam.salerName != null and saAggParam.salerName != ''"> and saler_name in
|
||||||
|
<foreach collection="saAggParam.salerName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="saAggParam.stdGoodsName != null and saAggParam.stdGoodsName != ''"> and std_goods_name in
|
||||||
|
<foreach collection="saAggParam.stdGoodsName" item="name" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
||||||
|
custom_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
||||||
|
std_goods_name,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
||||||
|
zone_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
||||||
|
sale_type_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||||
|
dosage_id,
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||||
|
saler_id,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
) yoy_month ON
|
||||||
|
<trim prefixOverrides="and">
|
||||||
|
<if test="groupFieldList.contains('customName') || params.containsKey('customName')">
|
||||||
|
AND yoy_month.custom_id = current_month.custom_id
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
||||||
|
AND yoy_month.std_goods_name = current_month.std_goods_name
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('zoneName') || params.containsKey('zoneName')">
|
||||||
|
AND yoy_month.zone_id = current_month.zone_id
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('saleTypeName') || params.containsKey('saleTypeName')">
|
||||||
|
AND yoy_month.sale_type_id = current_month.sale_type_id
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||||
|
AND yoy_month.dosage_id = current_month.dosage_id
|
||||||
|
</if>
|
||||||
|
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||||
|
AND yoy_month.saler_id = current_month.saler_id
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
|
||||||
, (
|
, (
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user