Commit 05d37edf by lijingjing

对有关原铝统计添加原铝重取的数据;

parent b2772b74
......@@ -185,6 +185,13 @@ public class StatisticsController extends ServiceController {
return success(statsService.getAlBrandsRate(queryDTO));
}
@ApiOperation("原铝低铁统计")
@Login(action = Action.Skip)
@PostMapping("/al_brands_low_fe")
public RestResult<Integer> selectAlBrandLowFeStats(QueryDTO queryDTO) {
return success(statsService.selectAlBrandLowFeStats(queryDTO));
}
@ApiOperation("昨日原铝质量统计")
@Login(action = Action.Skip)
@PostMapping("/prev_al_brands_rate")
......
......@@ -17,6 +17,8 @@ public interface IStatisticsService extends IBaseService<Statistics> {
*/
List<Statistics> getAlBrandsRate(QueryDTO queryDTO);
Integer selectAlBrandLowFeStats(QueryDTO queryDTO);
List<Statistics> getPrevAlBrandsRate(QueryDTO queryDTO);
List<Statistics> getEntrustedQuantity(QueryDTO queryDTO);
......
......@@ -93,6 +93,15 @@ public class StatisticsServiceImpl extends BaseServiceImpl<StatisticsMapper, Sta
}
@Override
public Integer selectAlBrandLowFeStats(QueryDTO queryDTO) {
RestAssert.fail(StringUtils.isBlank(queryDTO.getType()), "牌号不能为空!");
if (null == queryDTO.getQueryDate()) {
queryDTO.setQueryDate(new Date());
}
return baseMapper.selectAlBrandLowFeStats(queryDTO);
}
@Override
public List<Statistics> getPrevAlBrandsRate(QueryDTO queryDTO) {
return getAlBrandsRate(queryDTO);
}
......
......@@ -13,7 +13,7 @@ spring:
type: com.zaxxer.hikari.HikariDataSource
username: postgres
password: www.163.com
url: jdbc:postgresql://192.168.1.140:5432/dev_hmhj_pro
url: jdbc:postgresql://192.168.1.140:5432/dev_hmhj
driver-class-name: org.postgresql.Driver
dynamic:
enabled: false
......@@ -22,7 +22,7 @@ spring:
consul:
host: localhost
rabbitmq:
host: 192.168.1.140
host: localhost
port: 5672
username: mqbase
password: mqb123#@$5
......
......@@ -204,14 +204,15 @@
with ix as (
SELECT
s.id "sample_id",
case when s.sample_grading = 'Al99.85' then 1 else 0 end "al_85_num",
case when s.sample_grading = 'Al99.80' then 1 else 0 end "al_80_num",
case when s.sample_grading = 'Al99.70' then 1 else 0 end "al_70_num",
case when s.sample_grading = 'Al99.70DT' then 1 else 0 end "al_70_dt_num",
case when (s.sample_grading = 'Al99.85' or s.sample_grading = 'Al99.80' or s.sample_grading = 'Al99.70' or s.sample_grading = 'Al99.70DT') then 1 else 0 end "al_70_ge_num"
case when coalesce(s.sample_grading,rs.sample_grading) = 'Al99.85' then 1 else 0 end "al_85_num",
case when coalesce(s.sample_grading,rs.sample_grading) = 'Al99.80' then 1 else 0 end "al_80_num",
case when coalesce(s.sample_grading,rs.sample_grading) = 'Al99.70' then 1 else 0 end "al_70_num",
case when coalesce(s.sample_grading,rs.sample_grading) = 'Al99.70DT' then 1 else 0 end "al_70_dt_num",
case when coalesce(s.sample_grading,rs.sample_grading) in ('Al99.85' ,'Al99.80','Al99.70','Al99.70DT') then 1 else 0 end "al_70_ge_num"
FROM
entrust_sample s
JOIN electrolyzer e ON s.electrolyzer_id = e.ID
LEFT JOIN entrust_sample rs on rs.source_code = s.code and rs.name = '原铝重取' and rs.deleted = 0
WHERE
s.deleted = 0 and e.deleted = 0 AND s.type = 0
AND s.status = 70
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment