| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ycl.common.utils.SecurityUtils; |
| | | import com.ycl.domain.entity.ProjectInvestmentFunding; |
| | | import com.ycl.domain.entity.ProjectInvestmentInfo; |
| | |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | baseMapper.insert(entity); |
| | | //避免新增一个后重复新增返回id给前端判断 |
| | | return Result.ok("添加成功").data(entity.getId()); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public Result detail(Integer id) { |
| | | QueryWrapper<ProjectInvestmentFunding> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("project_id",id); |
| | | ProjectInvestmentFunding entity = baseMapper.selectOne(queryWrapper); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | ProjectInvestmentFundingVO vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null); |
| | | ProjectInvestmentFunding entity = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInvestmentFunding::getProjectId, id) |
| | | .one(); |
| | | ProjectInvestmentFundingVO vo =new ProjectInvestmentFundingVO(); |
| | | if(entity!=null){ |
| | | vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null); |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | | |