Commit 43a7083f by huluobin

# 更新

parent fb33552a
...@@ -262,4 +262,6 @@ public class CostDto { ...@@ -262,4 +262,6 @@ public class CostDto {
private Boolean isManageCost; private Boolean isManageCost;
private String departmentName;
} }
...@@ -78,4 +78,8 @@ public interface CostDao extends BaseMapper<CostDomain> { ...@@ -78,4 +78,8 @@ public interface CostDao extends BaseMapper<CostDomain> {
@Param("req") CostQueryPageReq req); @Param("req") CostQueryPageReq req);
List<CostDomain> manageCostList(ManageCostListReq req); List<CostDomain> manageCostList(ManageCostListReq req);
List<CostDomain> getCostList(@Param("page") IPage<CostDomain> page,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
} }
...@@ -264,6 +264,9 @@ public class CostDomain implements Serializable { ...@@ -264,6 +264,9 @@ public class CostDomain implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<CostDetailDomain> costDetailDomainList; private List<CostDetailDomain> costDetailDomainList;
@TableField(exist = false)
private String departmentName;
public void setCostType(CostTypeDomain costTypeDomain) { public void setCostType(CostTypeDomain costTypeDomain) {
......
...@@ -265,10 +265,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -265,10 +265,7 @@ public class CostApiServiceImpl implements CostApiService {
public List<CostDto> getCostList(String startDate, String endDate, Integer pageNum, Integer pageSize) { public List<CostDto> getCostList(String startDate, String endDate, Integer pageNum, Integer pageSize) {
IPage<CostDomain> page = new Page<>(pageNum, pageSize); IPage<CostDomain> page = new Page<>(pageNum, pageSize);
return this.costDao.selectPage(page, new LambdaQueryWrapper<CostDomain>() return this.costDao.getCostList(page, startDate, endDate)
.ge(CostDomain::getLastModifyDate, startDate)
.le(CostDomain::getLastModifyDate, endDate))
.getRecords()
.stream() .stream()
.map(CostDomain::castToDto) .map(CostDomain::castToDto)
.collect(Collectors.toList()); .collect(Collectors.toList());
......
...@@ -334,4 +334,11 @@ ...@@ -334,4 +334,11 @@
and t1.last_modify_date between #{startDateStr} and #{endDateStr} and t1.last_modify_date between #{startDateStr} and #{endDateStr}
</select> </select>
<select id="getCostList" resultType="com.blt.other.module.cost.model.CostDomain">
select t1.*, od.name department_name
from cost t1
left join oa_user t2 on t1.create_userid = t2.oa_user_id
left join oa_department od on t2.department_id = od.department_id
</select>
</mapper> </mapper>
package com.blt.other.module.cost.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostApiService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/2/27 6:24 下午
*/
@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
@ActiveProfiles("test")
public class CostApiServiceImplTest {
@Resource
CostApiService costApiService;
@Test
public void getCostList() {
costApiService.getCostList("2021-01-01 00:00:00", "2021-01-01 00:00:00", 1, 10);
}
}
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