|
|
@@ -2353,14 +2353,22 @@ public class ProductServiceImpl implements ProductService {
|
|
|
public ResultMap countProduct(Long fromDate, Long toDate) {
|
|
|
if (fromDate == null || toDate == null) {
|
|
|
//统计所有的未审核的品牌信息
|
|
|
- Integer count = jdbcTemplate.queryForInt("select count(1) from products p left join product$private pp on p.pr_id = pp.pr_id where pp.pr_b2cenabled = 1;");
|
|
|
- return ResultMap.success(count);
|
|
|
+ Map<String, Integer> map = new HashedMap();
|
|
|
+ Integer productAmout = jdbcTemplate.queryForInt("select count(1) from products p left join product$private pp on p.pr_id = pp.pr_id where pp.pr_b2cenabled = 1;");
|
|
|
+ map.put("productAmout", productAmout);
|
|
|
+ Integer productUserAmout = jdbcTemplate.queryForInt("select count(DISTINCT pr_enuu) from products p left join product$private pp on p.pr_id = pp.pr_id where pp.pr_b2cenabled = 1;");
|
|
|
+ map.put("productUserAmout", productUserAmout);
|
|
|
+ return ResultMap.success(map);
|
|
|
} else {
|
|
|
Date fromT = new Date(fromDate);
|
|
|
Date toT = new Date(toDate);
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- Integer count = jdbcTemplate.queryForInt("select count(1) from products p left join product$private pp on p.pr_id = pp.pr_id where pr_create_time < '" + dateFormat.format(toT) + "' and pr_create_time > '" + dateFormat.format(fromT) + "' and pp.pr_b2cenabled = 1;");
|
|
|
- return ResultMap.success(count);
|
|
|
+ Map<String, Integer> map = new HashedMap();
|
|
|
+ Integer productAmout = jdbcTemplate.queryForInt("select count(1) from products p left join product$private pp on p.pr_id = pp.pr_id where pr_create_time < '" + dateFormat.format(toT) + "' and pr_create_time > '" + dateFormat.format(fromT) + "' and pp.pr_b2cenabled = 1;");
|
|
|
+ map.put("productAmout", productAmout);
|
|
|
+ Integer productUserAmout = jdbcTemplate.queryForInt("select count(DISTINCT pr_enuu) from products p left join product$private pp on p.pr_id = pp.pr_id where pr_create_time < '" + dateFormat.format(toT) + "' and pr_create_time > '" + dateFormat.format(fromT) + "' and pp.pr_b2cenabled = 1;");
|
|
|
+ map.put("productUserAmout", productUserAmout);
|
|
|
+ return ResultMap.success(map);
|
|
|
}
|
|
|
}
|
|
|
}
|