Commit 7ce02b1b by 李小惠

修改出入库接口,修改报表接口(未完成,spoon的代码也未完成)

parent ba464479
......@@ -17,4 +17,8 @@ public class TjOrgCountReq extends BaseRequest {
@NotNull(message = "年份不能为空",groups = detail.class)
private Integer year;
private List<Integer> monthList;
private Boolean removeEmpty;
private String typeParentId;
private Integer levelNum;
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ public enum OrderExceptionEnum implements IExceptionEnum {
ORDERDETAIL_ERROR(CommonConstant.DEFAULT_USER_ERROR_CODE,"子单据不一致,操作失败"),
ROLE_ERROR(CommonConstant.DEFAULT_USER_ERROR_CODE,"审核组织机构用户配置异常!请检查日志"),
ORDER_CREATE_ERROR(CommonConstant.DEFAULT_USER_ERROR_CODE,"单子创建失败"),
ORDER_NUM_IS_NULL(CommonConstant.DEFAULT_USER_ERROR_CODE,"请先选择仓库确认"),
ORDER_NUM_IS_NULL(CommonConstant.DEFAULT_USER_ERROR_CODE,"记账数量为空或0,请确认记账数量"),
;
/**
......
......@@ -151,6 +151,12 @@ public class TjController {
return ApiRes.success(tjService.TjOrgCountSum(req));
}
@PostMapping("/TjOrgCountDetail")
@ApiOperation("/查询组织机构下的使用统计明细")
public ApiRes<List<TjOrgCountDto>> TjOrgPriceDetail(@RequestBody TjOrgCountReq req){
return ApiRes.success(tjService.TjOrgCountDetail(req));
}
//财务统计报表(点击+后里面的数据)
@PostMapping("/TjOrgCountDetailPage")
@ApiOperation("/查询组织机构下的使用统计明细")
......
......@@ -63,6 +63,11 @@ public class PoliceEquipment implements Serializable {
@TableField("num")
private Integer num;
@TableField(value = "in_num")
private Integer inNum;
@TableField(value = "out_num")
private Integer outNum;
/**
* 组织机构ID
*/
......@@ -97,6 +102,8 @@ public class PoliceEquipment implements Serializable {
@TableField("create_time")
private Date createTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -19,10 +19,29 @@ public interface EquipmentCountSummaryMapper extends BaseMapper<EquipmentCountSu
void addInfo(@Param("sql") String sql);
List<TjOrgCountDto> TjOrgCount(@Param("orgId") Long orgId,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList") List<String> sizeNameList,
@Param("year")Integer year);
TjOrgCountDto TjOrgCount(@Param("orgId") String orgId,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList") List<String> sizeNameList,
@Param("year")Integer year,
@Param("typeParentId")String typeParentId,
@Param("monthList") List<Integer> monthList);
TjOrgCountDto TjOrgCountleve4(@Param("orgId") Long orgId,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList") List<String> sizeNameList,
@Param("year") Integer year,
@Param("typeParentId")String typeParentId,
@Param("monthList") List<Integer> monthList,
@Param("levelFlag")Integer levelFlag);
List<TjOrgCountDto> TjOrgCountTotalNum(@Param("orgId") Long orgId,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList") List<String> sizeNameList,
@Param("year") Integer year,
@Param("typeParentId")String typeParentId,
@Param("monthList") List<Integer> monthList,
@Param("levelNum")Integer levelNum);
FinalTjOrgCountDto TjOrgCountSum(@Param("orgId") Long orgId,
@Param("sizeNameList") List<String> sizeNameList,
......@@ -47,6 +66,8 @@ public interface EquipmentCountSummaryMapper extends BaseMapper<EquipmentCountSu
void setSizeName(@Param("sizeId") String id,@Param("sizeName") String name);
void setTypeName(@Param("typeId") String id,@Param("typeName") String name);
}
......
......@@ -44,9 +44,9 @@ public interface PriceSumSummaryMapper extends BaseMapper<PriceSumSummary> {
@Param("typeIdsList")List<String> typeIdsList,
@Param("sizeNameList") List<String> sizeNameList);
FinalTjOrgPriceDto TjOrgPriceSum(@Param("orgId") Long orgId,@Param("year") Integer year,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList") List<String> sizeNameList);
// FinalTjOrgPriceDto TjOrgPriceSum(@Param("orgId") Long orgId,@Param("year") Integer year,
// @Param("typeIdsList") List<String> typeIdsList,
// @Param("sizeNameList") List<String> sizeNameList);
void setSizeName(@Param("sizeId") String id, @Param("sizeName") String name);
......@@ -55,10 +55,12 @@ public interface PriceSumSummaryMapper extends BaseMapper<PriceSumSummary> {
TjOrgPriceDto TjOrgPriceLeve4(@Param("orgId") Long orgId,
@Param("year") Integer year,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList")List<String> sizeNameList,@Param("levelFlag")Integer levelFlag);
@Param("sizeNameList")List<String> sizeNameList,
@Param("levelFlag")Integer levelFlag);
List<TjOrgPriceDto> TjOrgPriceTotalNum(@Param("orgId") Long orgId,
@Param("year") Integer year,
@Param("typeIdsList") List<String> typeIdsList,
@Param("sizeNameList")List<String> sizeNameList,@Param("levelNum")Integer levelNum);
@Param("sizeNameList")List<String> sizeNameList,
@Param("levelNum")Integer levelNum);
}
......@@ -44,7 +44,7 @@ public class OutInLogsReceiver {
logRecordDTO.setLogType(30);
logRecordDTO.setRequestUrl("queues = \"orderResult\"");
try {
// System.out.println("msg = " + msg);
System.out.println("msg = " + msg);
// 创建日志对象
// 手动确认消息
......
......@@ -37,6 +37,8 @@ public interface TjService {
FinalTjOrgCountDto TjOrgCountSum(TjOrgCountReq req);
List<TjOrgCountDto> TjOrgCountDetail(TjOrgCountReq req);
PageResult<TjOrgCountDto> TjOrgCountDetailPage(TjOrgCountReq req);
List<TjOrgCountDto> TjOrgCountDetailList(TjOrgCountReq req);
......@@ -64,4 +66,6 @@ public interface TjService {
void TjOrgEqsExport(TjOrgEqsReq req);
}
......@@ -83,7 +83,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
List<EquipmentSize> list = list(new LambdaQueryWrapper<EquipmentSize>()
.eq(EquipmentSize::getTypeId,req.getTypeId())
.orderByDesc(EquipmentSize::getCode));
String code="0";
String code="1";
if (list.size()>0){
int i = Integer.parseInt(list.get(0).getCode());
code=String.valueOf(i+1);
......@@ -103,7 +103,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
size.setUpdateTime(DateTimeUtil.getCurrentDateTime());
this.save(size);
sizeRepository.save(size);
return sizeID;
return sizeID+"||"+code;
}
@Override
......
......@@ -145,6 +145,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
List<OrderDetail> detailList = orderDetailService
.list(new LambdaQueryWrapper<OrderDetail>().eq(OrderDetail::getOrderId, one.getId()));
for (OrderDetail orderDetail:detailList) {
boolean flag=false;
for (DetailOrderReq detailReq:orderDetailList) {
if (detailReq.getId().equals(String.valueOf(orderDetail.getId()))){
if (ObjectUtil.isNull(orderDetail.getActualNum())){
......@@ -154,8 +155,14 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
orderDetail.setModifyQuantity(detailReq.getActualNum());
orderDetail.setActualNum(detailReq.getActualNum());
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
flag=true;
break;
}
break;
}
if (!flag){
orderDetail.setActualNum(0);
orderDetail.setModifyQuantity(0);
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
}
}
b=orderDetailService.updateBatchById(detailList);
......@@ -448,8 +455,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
if (!updateStateWrapper1.isEmptyOfWhere()){
inventoryService.update(updateStateWrapper1);
warehouseInventoryService.update(updateStateWrapper2);
}
System.out.println(1111);
if (!allocateInWrapper1.isEmptyOfWhere()){
inventoryService.update(allocateInWrapper1);
......
......@@ -500,8 +500,6 @@ public class TjServiceImpl implements TjService {
tjOrgPriceDtoList.add(OrgData);//把本级数据加进去
}
for (TjOrgPriceDto tj:tjOrgPriceDtoList) {
System.out.println("tj.getStartNum() = " + tj.getStartNum());
System.out.println("ObjectUtil.isNull(tj.getAddNum()) = " + ObjectUtil.isNull(tj.getAddNum()));
tj.setAddNum(ObjectUtil.isNull(tj.getAddNum())?0:tj.getAddNum());
tj.setStartNum(ObjectUtil.isNull(tj.getStartNum())?0:tj.getStartNum());
tj.setEndNum(ObjectUtil.isNull(tj.getEndNum())?0:tj.getEndNum());
......@@ -530,9 +528,6 @@ public class TjServiceImpl implements TjService {
tjOrgPriceDtoList.removeIf(tjOrgEqsDto -> tjOrgEqsDto.getStartNum() == 0 && tjOrgEqsDto.getEndNum() == 0
&& tjOrgEqsDto.getDestoryNum()==0);
}
//将组织机构进行排序后再进行返回
Comparator<TjOrgPriceDto> orgComparator = createOrgComparator();
Collections.sort(tjOrgPriceDtoList, orgComparator);
return tjOrgPriceDtoList;
}
......@@ -618,33 +613,87 @@ public class TjServiceImpl implements TjService {
@Override
public PageResult<TjOrgCountDto> TjOrgCount(TjOrgCountReq req) {
List<TjOrgCountDto> tjOrgCountDtoList =equipmentCountSummaryMapper.TjOrgCount(req.getOrgId(),
req.getTypeIdsList(),req.getSizeNameList(),req.getYear());
//先拿到符合条件的组织机构,再遍历组织机构组成数据
//(下一层数据组织机构数据)
PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
List<String> orgList= inventorySummaryMapper.getTotalData(String.valueOf(req.getOrgId()));
List<TjOrgCountDto> tjOrgCountList=new ArrayList<>();
for (String orgId:orgList) {
TjOrgCountDto orgData =equipmentCountSummaryMapper.TjOrgCount(orgId,
req.getTypeIdsList(),req.getSizeNameList(),req.getYear(),req.getTypeParentId(),req.getMonthList());
orgData.setNumber(ObjectUtil.isNull(orgData.getNumber())?0:orgData.getNumber());
orgData.setUseCount(ObjectUtil.isNull(orgData.getUseCount())?0:orgData.getUseCount());
orgData.setFixCount(ObjectUtil.isNull(orgData.getFixCount())?0:orgData.getFixCount());
tjOrgCountList.add(orgData);
}
if (req.getOrgId()!=1369509498032808905L){
TjOrgCountDto orgData =equipmentCountSummaryMapper.TjOrgCountleve4(req.getOrgId(),
req.getTypeIdsList(),req.getSizeNameList(),req.getYear(),req.getTypeParentId(),req.getMonthList(),pubOrg.getLevelFlag());
tjOrgCountList.add(orgData);
}
//查询出来的组织机构进行判断,如果该组织机构下的装备装备总数为0,那么将该组织机构从list中移除
if (req.getRemoveEmpty()){
tjOrgCountList.removeIf(TjOrgCountDto -> TjOrgCountDto.getNumber() == 0 );
}
//对组织机构进行排序
Comparator<TjOrgCountDto> orgComparator = createOrgComparator();
Collections.sort(tjOrgCountDtoList, orgComparator);
Collections.sort(tjOrgCountList, orgComparator);
Page<TjOrgCountDto> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
if (ObjectUtil.isNull(req.getPageNo()) && ObjectUtil.isNull(req.getPageSize())) {
req.setPageNo(1L);
req.setPageSize(10L);
}
long startIndex = (req.getPageNo() - 1) * req.getPageSize();
long endIndex = Math.min(startIndex + req.getPageSize(), tjOrgCountDtoList.size());
List<TjOrgCountDto> subList = tjOrgCountDtoList.subList((int) startIndex, (int)endIndex);
page.setTotal(tjOrgCountDtoList.size());
long endIndex = Math.min(startIndex + req.getPageSize(), tjOrgCountList.size());
List<TjOrgCountDto> subList = tjOrgCountList.subList((int) startIndex, (int)endIndex);
page.setTotal(tjOrgCountList.size());
page.setRecords(subList);
return PageResultFactory.createPageResult(page);
}
@Override
public FinalTjOrgCountDto TjOrgCountSum(TjOrgCountReq req) {
FinalTjOrgCountDto finalTjOrgCountDto =equipmentCountSummaryMapper.TjOrgCountSum(req.getOrgId(),req.getSizeNameList(),
req.getTypeIdsList(), req.getYear());
if (ObjectUtil.isNotNull(finalTjOrgCountDto)) {
return finalTjOrgCountDto;
}else {
return new FinalTjOrgCountDto();
FinalTjOrgCountDto finalTjOrgCountDto=new FinalTjOrgCountDto();
finalTjOrgCountDto.setFixCount(0);
finalTjOrgCountDto.setUseCount(0);
finalTjOrgCountDto.setNumber(0);
PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
List<String> orgList= inventorySummaryMapper.getTotalData(String.valueOf(req.getOrgId()));
List<TjOrgCountDto> tjOrgCountList=new ArrayList<>();
for (String orgId:orgList) {
TjOrgCountDto orgData =equipmentCountSummaryMapper.TjOrgCount(orgId,
req.getTypeIdsList(),req.getSizeNameList(),req.getYear(),req.getTypeParentId(),req.getMonthList());
orgData.setNumber(ObjectUtil.isNull(orgData.getNumber())?0:orgData.getNumber());
orgData.setUseCount(ObjectUtil.isNull(orgData.getUseCount())?0:orgData.getUseCount());
orgData.setFixCount(ObjectUtil.isNull(orgData.getFixCount())?0:orgData.getFixCount());
tjOrgCountList.add(orgData);
}
if (req.getOrgId()!=1369509498032808905L){
TjOrgCountDto orgData =equipmentCountSummaryMapper.TjOrgCountleve4(req.getOrgId(),
req.getTypeIdsList(),req.getSizeNameList(),req.getYear(),req.getTypeParentId(),req.getMonthList(),pubOrg.getLevelFlag());
tjOrgCountList.add(orgData);
}
for (TjOrgCountDto tj:tjOrgCountList) {
tj.setFixCount(ObjectUtil.isNull(tj.getFixCount())?0: tj.getFixCount());
tj.setUseCount(ObjectUtil.isNull(tj.getUseCount())?0: tj.getUseCount());
tj.setNumber(ObjectUtil.isNull(tj.getNumber())?0: tj.getNumber());
finalTjOrgCountDto.setFixCount(finalTjOrgCountDto.getFixCount()+tj.getFixCount());
finalTjOrgCountDto.setUseCount(finalTjOrgCountDto.getUseCount()+ tj.getUseCount());
finalTjOrgCountDto.setNumber(finalTjOrgCountDto.getNumber()+ tj.getNumber());
}
return finalTjOrgCountDto;
}
@Override
public List<TjOrgCountDto> TjOrgCountDetail(TjOrgCountReq req) {
List<TjOrgCountDto> tjOrgCountDtoList=equipmentCountSummaryMapper.TjOrgCountTotalNum(req.getOrgId(),
req.getTypeIdsList(),req.getSizeNameList(),req.getYear(),req.getTypeParentId(),req.getMonthList(),req.getLevelNum());
if (req.getRemoveEmpty()){
tjOrgCountDtoList.removeIf(tjOrgCountDto -> tjOrgCountDto.getNumber()==0 );
}
return tjOrgCountDtoList;
}
@Override
......
......@@ -58,47 +58,53 @@
{call AddEquipmentCountSummary(#{sql,mode=IN})}
</insert>
<select id="TjOrgCount" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto">
SELECT
t.org_id,
max(t.org_code) as org_code,
max(t.org_name) as org_name,
max(t.parent_id) as parent_id,
max(t.d_name) AS d_name,
select t1.org_id,t1.org_code,t1.org_name,t1.d_name,t2.year,t2.use_count,t2.fix_count,t2.number
FROM(
SELECT
`org_id`, `org_code`, `org_name`, `d_name`
FROM `pub_org`
WHERE org_id=#{orgId}
) as t1
CROSS JOIN (
SELECT
MAX(t.`year`) AS `year`,
SUM(t.use_count) AS use_count,
SUM(t.fix_count) AS fix_count,
sum(CASE WHEN t.month = MONTH(CURRENT_DATE()) THEN t.number ELSE 0 END) AS number
FROM (
SELECT
org_id_int AS org_id,
max(org_code) as org_code,
max(org_name) as org_name,
max(parent_id) as parent_id,
max(org_name_short) AS d_name,
`year`,
`month`,
SUM(use_count) AS use_count,
SUM(fix_count) AS fix_count,
sum(number) as number
FROM vie_equipment_count_summary
where `year`= #{year} and (org_id_int=#{orgId} or parent_id=#{orgId})
<if test="typeIdsList!=null and typeIdsList.size() > 0">
and type_id in
<foreach collection="typeIdsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY org_id,`year`,month
) AS t
GROUP BY
t.org_id
FROM (
SELECT
vecs.`year`,
vecs.`month`,
SUM(vecs.use_count) AS use_count,
SUM(vecs.fix_count) AS fix_count,
sum(vecs.number) as number
FROM vie_equipment_count_summary vecs
left join pub_org po on vecs.org_id_int=po.org_id
where vecs.`year`= #{year} and po.del_flag=1 and (po.org_id=#{orgId} or po.org_parent_ids like CONCAT('%',#{orgId}, '%'))
<if test="typeIdsList!=null and typeIdsList.size() > 0">
and vecs.type_id in
<foreach collection="typeIdsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="typeParentId != null and typeParentId !=''">
and vecs.type_parnet_id=#{typeParentId}
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
vecs.size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
<if test="monthList != null and monthList.size()>0">
and vecs.month in
<foreach collection="monthList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY `year`,month
) AS t
)as t2
</select>
<select id="TjOrgCountSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgCountDto">
select sum(use_count) as use_count,sum(fix_count) as fix_count,sum(number) as number FROM (
......@@ -276,7 +282,103 @@
</foreach>
</if>
GROUP BY org_id,type_parent_id) as a on a.type_parent_id=et.id
where TRIM(et.parent_ids )='' and et.id !="00000000-0000-0000-0000-000000000000"
where et.parent_id="00000000-0000-0000-0000-000000000000" and et.id !="00000000-0000-0000-0000-000000000000"
GROUP BY et.id,et.name,a.org_id
</select>
<select id="TjOrgCountleve4" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto">
select t1.org_id,t1.org_code,t1.org_name,t1.d_name,t2.year,t2.use_count,t2.fix_count,t2.number
FROM(
SELECT
`org_id`, `org_code`, `org_name`, `d_name`
FROM `pub_org`
WHERE org_id=#{orgId}
) as t1
CROSS JOIN (
SELECT
MAX(t.`year`) AS `year`,
SUM(t.use_count) AS use_count,
SUM(t.fix_count) AS fix_count,
sum(CASE WHEN t.month = MONTH(CURRENT_DATE()) THEN t.number ELSE 0 END) AS number
FROM (
SELECT
vecs.`year`,
vecs.`month`,
SUM(vecs.use_count) AS use_count,
SUM(vecs.fix_count) AS fix_count,
sum(vecs.number) as number
FROM vie_equipment_count_summary vecs
left join pub_org po on vecs.org_id_int=po.org_id
where vecs.`year`= #{year} and po.del_flag=1 AND (po.org_id = #{orgId} OR (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
AND(case when #{levelFlag} >=3 then 1=1 else SUBSTRING(`po`.`org_code`, 5, 2) = '00' end ))
AND (
`po`.`level_flag` > (
SELECT `level_flag` FROM `pub_org` WHERE `org_id` = #{orgId}
) + 1
OR (`po`.`level_flag` = (
SELECT `level_flag` FROM `pub_org` WHERE `org_id` = #{orgId}
))))
<if test="typeIdsList!=null and typeIdsList.size() > 0">
and vecs.type_id in
<foreach collection="typeIdsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="typeParentId != null and typeParentId !=''">
and vecs.type_parnet_id=#{typeParentId}
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
vecs.size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
<if test="monthList != null and monthList.size()>0">
and vecs.month in
<foreach collection="monthList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY `year`,month
) AS t
)as t2
</select>
<select id="TjOrgCountTotalNum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto">
SELECT MAX( t.`year` ) AS `year`,SUM( t.use_count ) AS use_count,SUM( t.fix_count ) AS fix_count,
size_id,size_name,type_id,type_name,
sum( CASE WHEN t.MONTH = MONTH ( CURRENT_DATE ()) THEN t.number ELSE 0 END ) AS number
FROM
(
SELECT
vecs.`year`,
vecs.`month`,
SUM( vecs.use_count ) AS use_count,
SUM( vecs.fix_count ) AS fix_count,
vecs.size_id,
vecs.size_name,
vecs.type_id,
vecs.type_name,
sum( vecs.number ) AS number
FROM
vie_equipment_count_summary vecs
LEFT JOIN pub_org po ON vecs.org_id_int = po.org_id
WHERE
YEAR = #{year}
and `po`.`del_flag` = 1 and (po.org_id=#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
AND (
`po`.level_flag >(SELECT
level_flag FROM pub_org WHERE org_id = #{orgId} )+ #{levelNum}
OR `po`.level_flag =(SELECT level_flag FROM pub_org WHERE org_id = #{orgId}
))
GROUP BY
`year`,MONTH,size_id,size_name,type_id,type_name
) AS t
GROUP BY
t.size_id,t.size_name,t.type_id,t.type_name
ORDER BY
t.type_id,size_id
</select>
</mapper>
......@@ -58,7 +58,7 @@
ORDER BY year, month;
</select>
<select id="ShowInOutRecords" resultType="com.junmp.jyzb.entity.LogSummary">
select ls.location_id,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
select ls.location_id,ls.use_time,ls.create_time,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
from base_log_summary ls
join (select summary_id,count(*)as number,max(size_name) as size_name,
max(type_name) as type_name,max(price)as price
......@@ -75,18 +75,22 @@
</if>
</select>
<select id="ShowInOutRecordsSum" resultType="java.lang.Integer">
select ls.location_id,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
from base_log_summary ls
join (select summary_id,count(*)as number,max(size_name) as size_name,
max(type_name) as type_name,max(price)as price
FROM base_log_detail ld
where org_id=#{orgId}
and type_id=#{typeId}
and size_id=#{sizeId}
and price=#{price}
GROUP BY summary_id
) as a on ls.id=a.summary_id
where ls.org_id=#{orgId} and ls.location_type=0
select count(*)
from (select ls.location_id,ls.use_time, ls.location_name, ls.bussiness_type, ls.out_in_state, ls.user_name, a.*
from base_log_summary ls
join (select summary_id,
count(*) as number,
max(size_name) as size_name,
max(type_name) as type_name,
max(price) as price
FROM base_log_detail ld
where org_id = #{orgId}
and type_id = #{typeId}
and size_id = #{sizeId}
and price = #{price}
GROUP BY summary_id) as a on ls.id = a.summary_id
where ls.org_id = #{orgId}
and ls.location_type = 0) as b
</select>
......
......@@ -96,33 +96,33 @@
</if>
</select>
<select id="TjOrgPriceSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgPriceDto">
select sum(coalesce(start_num,0)) as start_num,sum(coalesce(start_price,0)) as start_price,
sum(coalesce(end_num,0)) as end_num,sum(coalesce(end_price,0)) as end_price,
sum(coalesce(add_num,0)) as add_num,sum(coalesce(destory_num,0)) as destory_num,
sum(coalesce(add_price,0)) as add_price,sum(coalesce(destory_price,0)) as destory_price FROM (
select org_id_int as org_id,org_code,org_name,
sum(start_num) as start_num,sum(start_price) as start_price,
sum(end_num) as end_num,sum(end_price) as end_price,
sum(add_num) as add_num,sum(destory_num) as destory_num,
sum(add_price) as add_price,sum(destory_price) as destory_price
FROM vie_price_sum_summary
where `year`= #{year} and (org_id_int=#{orgId} or parent_id=#{orgId})
<if test="typeIdsList!=null and typeIdsList.size() > 0">
and type_id in
<foreach collection="typeIdsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="sizeNameList!=null and !sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY org_id,org_code,org_name
) as t
</select>
<!-- <select id="TjOrgPriceSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgPriceDto">-->
<!-- select sum(coalesce(start_num,0)) as start_num,sum(coalesce(start_price,0)) as start_price,-->
<!-- sum(coalesce(end_num,0)) as end_num,sum(coalesce(end_price,0)) as end_price,-->
<!-- sum(coalesce(add_num,0)) as add_num,sum(coalesce(destory_num,0)) as destory_num,-->
<!-- sum(coalesce(add_price,0)) as add_price,sum(coalesce(destory_price,0)) as destory_price FROM (-->
<!-- select org_id_int as org_id,org_code,org_name,-->
<!-- sum(start_num) as start_num,sum(start_price) as start_price,-->
<!-- sum(end_num) as end_num,sum(end_price) as end_price,-->
<!-- sum(add_num) as add_num,sum(destory_num) as destory_num,-->
<!-- sum(add_price) as add_price,sum(destory_price) as destory_price-->
<!-- FROM vie_price_sum_summary-->
<!-- where `year`= #{year} and (org_id_int=#{orgId} or parent_id=#{orgId})-->
<!-- <if test="typeIdsList!=null and typeIdsList.size() > 0">-->
<!-- and type_id in-->
<!-- <foreach collection="typeIdsList" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="sizeNameList!=null and !sizeNameList.size() > 0">-->
<!-- AND-->
<!-- <foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">-->
<!-- size_name like CONCAT('%', #{item}, '%')-->
<!-- </foreach>-->
<!-- </if>-->
<!-- GROUP BY org_id,org_code,org_name-->
<!-- ) as t-->
<!-- </select>-->
<select id="TjOrgPriceDetailSum" resultType="java.lang.Integer">
select count(*) from (
select org_id_int as org_id,org_code,org_name,type_id,type_name,
......
......@@ -38,7 +38,7 @@ spring:
redis:
#host: 192.168.3.188
host: 192.168.3.188
host: 192.168.3.121
port: 6379
database: 1
password:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论