之前的 现在取消
// /**
// * 响应请求总记录数+合同金额+销售合同
// */
// @SuppressWarnings({"rawtypes", "unchecked"})
// protected TableDataInfoXS getDataTableXs(List<?> list, ProjectXmshtXhzjVo projectXmshtXhzjVo) {
// TableDataInfoXS rspData = new TableDataInfoXS();
// rspData.setCode(HttpStatus.SUCCESS);
// rspData.setMsg("查询成功");
// rspData.setRows(list);
// rspData.setProjectXmshtXhzjVo(projectXmshtXhzjVo);
// return rspData;
// }
// /**
// * 响应请求总记录+数采购合同
// */
// @SuppressWarnings({"rawtypes", "unchecked"})
// protected TableDataInfoCG getDataTableCG(List<?> list, ProjectXmshtzjVo projectXmshtzjVo) {
// TableDataInfoCG rspData = new TableDataInfoCG();
// rspData.setCode(HttpStatus.SUCCESS);
// rspData.setMsg("查询成功");
// rspData.setRows(list);
// rspData.setProjectXmshtzjVo(projectXmshtzjVo);
// return rspData;
// }
返回给前端 也取消
package com.lzy.framework.web.page;
import com.lzy.project.project.domain.vo.ProjectXmshtzjVo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class TableDataInfoCG extends TableDataInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 列表数据
*/
private List<?> rows;
/**
* 消息状态码
*/
private int code;
/**
* 消息内容
*/
private String msg;
/**
* 采购合同总记录数
*/
private ProjectXmshtzjVo projectXmshtzjVo;
}
package com.lzy.framework.web.page;
import com.lzy.project.project.domain.vo.ProjectXmshtXhzjVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TableDataInfoXS extends TableDataInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 列表数据
*/
private List<?> rows;
/**
* 消息状态码
*/
private int code;
/**
* 消息内容
*/
private String msg;
/**
* 总记录数销售合同
*/
private ProjectXmshtXhzjVo projectXmshtXhzjVo;
}
新增两个接口
package com.lzy.project.project.controller;
import com.lzy.common.utils.StringUtils;
import com.lzy.common.utils.poi.ExcelUtil;
import com.lzy.framework.aspectj.lang.annotation.Log;
import com.lzy.framework.aspectj.lang.enums.BusinessType;
import com.lzy.framework.interceptor.annotation.RepeatSubmit;
import com.lzy.framework.web.controller.BaseController;
import com.lzy.framework.web.domain.AjaxResult;
import com.lzy.framework.web.page.TableDataInfo;
import com.lzy.project.operation.domain.ProjectFkgl;
import com.lzy.project.project.domain.ProjectXmht;
import com.lzy.project.project.domain.vo.ProjectXmhtVo;
import com.lzy.project.project.service.IProjectXmhtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 项目采购合同Controller
*
* @author gaochunhu
* @date 2021-09-18
*/
@RestController
@RequestMapping("/system/project/xmht")
public class ProjectXmhtController extends BaseController {
@Autowired
private IProjectXmhtService projectXmhtService;
/**
* 查询项目合同列表
*/
@GetMapping("/list")
public TableDataInfo list(ProjectXmht projectXmht) {
startPage();
List<ProjectXmhtVo> list = projectXmhtService.selectProjectXmhtList(projectXmht);
return getDataTable(list);
}
/**
* 采购合同同
*/
@GetMapping("/cghtlist")
public AjaxResult cghtlist() {
return AjaxResult.success(projectXmhtService.selectProjectXmshtCount());
}
@GetMapping("/listForGys")
public TableDataInfo listForGys(ProjectXmht projectXmht) {
startPage();
List<ProjectXmhtVo> list = projectXmhtService.selectProjectXmhtList(projectXmht);
return getDataTable(list);
}
/**
* 查询项目合同列表
*/
@GetMapping("/getlistAll")
public TableDataInfo getlistAll(Long sjid, Long htlx, String htmc) {
ProjectXmht obj = new ProjectXmht();
obj.setSjid(sjid);
obj.setHtlx(htlx);
obj.setHtmc(htmc);
List<ProjectXmhtVo> list = projectXmhtService.selectProjectXmhtList(obj);
return getDataTable(list);
}
/**
* 根据项目id查询项目合同列表
*/
@PostMapping("/getHtlistByXmId")
public AjaxResult getHtlistByXmId(@RequestBody ProjectXmhtVo projectXmhtVo) {
List<ProjectXmhtVo> list = projectXmhtService.getHtlistByXmId(projectXmhtVo);
return AjaxResult.success(list);
}
/**
* 导出项目合同列表
*/
@Log(title = "导出项目合同列表", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ProjectXmht projectXmht) {
List<ProjectXmhtVo> list = projectXmhtService.selectProjectXmhtList(projectXmht);
ExcelUtil<ProjectXmhtVo> util = new ExcelUtil<ProjectXmhtVo>(ProjectXmhtVo.class);
return util.exportExcel(list, "xmht");
}
/**
* 获取项目合同详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(projectXmhtService.selectProjectXmhtById(id));
}
/**
* 获取项目合同详细信息
*/
@PostMapping(value = "getInfoByHtbh")
public AjaxResult getInfoByHtbh(@RequestBody ProjectFkgl projectFkgl) {
if (StringUtils.isEmpty(projectFkgl.getHtbh())) {
return AjaxResult.success(new ProjectXmhtVo());
}
ProjectXmhtVo projectXmhtVo = projectXmhtService.selectProjectXmhtByHtbh(projectFkgl.getHtbh().trim());
if (projectXmhtVo == null) {
projectXmhtVo = new ProjectXmhtVo();
}
if (StringUtils.isNotEmpty(projectXmhtVo.getJf())) {
projectXmhtVo.setJf(projectXmhtVo.getJf().replaceAll(" ", "").replaceAll("<br>", ""));
}
if (StringUtils.isNotEmpty(projectXmhtVo.getQyf())) {
projectXmhtVo.setQyf(projectXmhtVo.getQyf().replaceAll(" ", "").replaceAll("<br>", ""));
}
if (StringUtils.isNotEmpty(projectXmhtVo.getHtnr())) {
projectXmhtVo.setHtnr(projectXmhtVo.getHtnr().replaceAll(" ", "").replaceAll("<br>", ""));
}
return AjaxResult.success(projectXmhtVo);
}
/**
* 获取项目合同详细信息
*/
@GetMapping(value = "/getXmcghtBySjid")
public TableDataInfo getXmcghtBySjid(ProjectXmhtVo projectXmht) {
startPage();
List<ProjectXmhtVo> projectXmhtVo = projectXmhtService.getXmcghtBySjid(projectXmht);
return getDataTable(projectXmhtVo);
}
/**
* 获取项目合同详细信息 根据khid
*/
@GetMapping(value = "getHtInfoByKhid")
public TableDataInfo getHtInfoByKhid(ProjectXmhtVo projectXmhtVo) {
startPage();
List<ProjectXmhtVo> projectXmhtVos = projectXmhtService.selectProjectXmhtByKhid(projectXmhtVo);
return getDataTable(projectXmhtVos);
}
/**
* 新增项目合同
*/
@Log(title = "新增项目合同", businessType = BusinessType.INSERT)
@PostMapping
@RepeatSubmit
public AjaxResult add(@RequestBody ProjectXmht projectXmht) {
return toAjax(projectXmhtService.insertProjectXmht(projectXmht));
}
/**
* 修改项目合同
*/
@Log(title = "修改项目合同", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProjectXmht projectXmht) {
return toAjax(projectXmhtService.updateProjectXmht(projectXmht));
}
/**
* 删除项目合同
*/
@Log(title = "删除项目合同", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(projectXmhtService.deleteProjectXmhtByIds(ids));
}
}
package com.lzy.project.project.controller;
import java.util.List;
import com.lzy.framework.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.lzy.framework.aspectj.lang.annotation.Log;
import com.lzy.framework.aspectj.lang.enums.BusinessType;
import com.lzy.framework.interceptor.annotation.RepeatSubmit;
import com.lzy.framework.web.controller.BaseController;
import com.lzy.framework.web.domain.AjaxResult;
import com.lzy.project.project.domain.ProjectXmxsht;
import com.lzy.project.project.domain.vo.ProjectXmxshtVo;
import com.lzy.project.project.service.IProjectXmxshtService;
/**
* 天诚项目-销售及售后合同Controller
*
* @author gaochunhu
* @date 2022-02-24
*/
@RestController
@RequestMapping("/system/project/xmxsht")
public class ProjectXmxshtController extends BaseController {
@Autowired
private IProjectXmxshtService projectXmxshtService;
/**
* 查询天诚项目-销售及售后合同列表
*/
@GetMapping("/list")
public TableDataInfo list(ProjectXmxsht projectXmxsht) {
startPage();
List<ProjectXmxsht> list = projectXmxshtService.selectProjectXmxshtList(projectXmxsht);
return getDataTable(list);
}
/**
* 销售合同
*/
@GetMapping("/xshtSum")
public AjaxResult xshtSum() {
return AjaxResult.success(projectXmxshtService.selectProjectXmxshtCount());
}
/**
* 获取天诚项目-销售及售后合同详细信息
*/
@GetMapping(value = "getInfo/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(projectXmxshtService.selectProjectXmxshtById(id));
}
/**
* 通过客户id查询合同信息
*/
@GetMapping("/getXshtByKhid/{khid}")
public AjaxResult getXshtByKhid(@PathVariable Long khid) {
List<ProjectXmxshtVo> list = projectXmxshtService.getXshtByKhid(khid);
return AjaxResult.success(list);
}
/**
* 通过商机id查询合同信息
*/
@GetMapping("/getXshtBySjid/{sjid}")
public AjaxResult getXshtBySjid(@PathVariable Long sjid) {
List<ProjectXmxshtVo> list = projectXmxshtService.getXshtBySjid(sjid);
return AjaxResult.success(list);
}
/**
* 新增天诚项目-销售及售后合同
*/
@Log(title = "新增-销售及售后合同", businessType = BusinessType.INSERT)
@RepeatSubmit
@PostMapping("/add")
public AjaxResult add(@RequestBody ProjectXmxsht projectXmxsht) {
projectXmxshtService.insertProjectXmxsht(projectXmxsht);
return AjaxResult.success(projectXmxsht);
}
/**
* 修改天诚项目-销售及售后合同
*/
@Log(title = "修改-销售及售后合同", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@RequestBody ProjectXmxsht projectXmxsht) {
projectXmxshtService.updateProjectXmxsht(projectXmxsht);
return AjaxResult.success(projectXmxsht);
}
/**
* 删除天诚项目-销售及售后合同
*/
@Log(title = "删除-销售及售后合同", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(projectXmxshtService.deleteProjectXmxshtByIds(ids));
}
}
实体类改为 BigDecimal
package com.lzy.project.project.domain.vo;
import com.lzy.framework.aspectj.lang.annotation.Excel;
import com.lzy.project.project.domain.ProjectXmxsht;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProjectXmshtXhzjVo{
/**
* 项目总数 销售合同
*/
@Excel(name = "项目总计")
private BigDecimal htzj;
/**
* 合同金额总计
*/
@Excel(name = "合同金额总计")
private BigDecimal htjezj;
/**
* 已收金额总计
*/
@Excel(name = "已收金额总计")
private BigDecimal ysjezj;
/**
* 应收金额总计
*/
@Excel(name = "应收金额总计")
private BigDecimal ysjeizj;
}
package com.lzy.project.project.domain.vo;
import com.lzy.framework.aspectj.lang.annotation.Excel;
import com.lzy.project.project.domain.ProjectXmht;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ProjectXmshtzjVo {
/**
* 采购合同
* 合同总计数
*/
@Excel(name = "合同数量总计")
private BigDecimal htslzj;
/**
* 合同金额总计
*/
@Excel(name = "合同金额总计")
private BigDecimal htjetj;
/**
* 已支付总计
*/
@Excel(name = "已支付总计")
private BigDecimal yzfzj;
/**
* 未支付总计
*/
@Excel(name = "未支付总计")
private BigDecimal wzfzj;
/**
* 待支付总计
*/
@Excel(name = "待支付总计")
private BigDecimal dzfzj;
}
xml中取消传参
package com.lzy.project.project.mapper;
import com.lzy.project.operation.domain.vo.ArapDetailsVo;
import com.lzy.project.project.domain.ProjectXmht;
import com.lzy.project.project.domain.vo.ProjectXmhtVo;
import com.lzy.project.project.domain.vo.ProjectXmshtzjVo;
import com.lzy.project.purchase.domain.vo.PurchaseCgdHtAddVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目合同Mapper接口
*
* @author gaochunhu
* @date 2021-09-18
*/
public interface ProjectXmhtMapper {
/**
* 查询项目合同
*
* @param id 项目合同ID
* @return 项目合同
*/
ProjectXmhtVo selectProjectXmhtById(Long id);
/**
* 查询项目合同
*
* @param htbh 项目合同ID
* @return 项目合同
*/
ProjectXmhtVo selectProjectXmhtByHtbh(String htbh);
/**
* 查询项目合同
*
* @param projectXmht
* @return 项目合同
*/
List<ProjectXmhtVo> getXmcghtBySjid(ProjectXmhtVo projectXmht);
/**
* 查询项目合同
*
* @param projectXmhtVo
* @return 项目合同
*/
List<ProjectXmhtVo> selectProjectXmhtByKhid(ProjectXmhtVo projectXmhtVo);
/**
* 查询项目合同列表
*
* @param projectXmht 项目合同
* @return 项目合同集合
*/
List<ProjectXmhtVo> selectProjectXmhtList(ProjectXmht projectXmht);
/**
* 采购合同总计 Sum总计
* @param
* @return
*/
ProjectXmshtzjVo SelectXmshtCount();
/**
* 根据项目id查询项目合同列表
*
* @param projectXmhtVo 项目合同
* @return 项目合同集合
*/
List<ProjectXmhtVo> getHtlistByXmId(ProjectXmhtVo projectXmhtVo);
/**
* 查询项目合同列表
*
* @param projectXmht
* @return
*/
List<ProjectXmhtVo> getProjectXmhtList(ProjectXmhtVo projectXmht);
/**
* 新增项目合同
*
* @param projectXmht 项目合同
* @return 结果
*/
int insertProjectXmht(ProjectXmht projectXmht);
/**
* 新增采购项目合同
*
* @param purchaseCgdHtAddVo 采购项目合同
* @return 结果
*/
void insertCght(PurchaseCgdHtAddVo purchaseCgdHtAddVo);
/**
* 修改项目合同
*
* @param projectXmht 项目合同
* @return 结果
*/
int updateProjectXmht(ProjectXmht projectXmht);
/**
* 删除项目合同
*
* @param id 项目合同ID
* @return 结果
*/
int deleteProjectXmhtById(Long id);
/**
* 批量删除项目合同
*
* @param ids 需要删除的数据ID
* @return 结果
*/
int deleteProjectXmhtByIds(Long[] ids);
/**
* 查询项目合同列表
*
* @param htids 合同id
* @param hkids 回款id
* @return 结果
*/
List<ProjectXmhtVo> getProjectXmhtByIds(@Param("htids") List<Long> htids, @Param("hkids") List<Long> hkids);
List<ProjectXmht> getProjectXmcghtBySjid(Long sjid);
List<ProjectXmht> getConfimXmcght(ArapDetailsVo arapDetailsVo);
}
package com.lzy.project.project.mapper;
import java.math.BigDecimal;
import java.util.List;
import com.lzy.project.operation.domain.vo.ArapDetailsVo;
import com.lzy.project.project.domain.vo.ProjectXmshtXhzjVo;
import org.apache.ibatis.annotations.Param;
import com.lzy.project.project.domain.ProjectXmxsht;
import com.lzy.project.project.domain.vo.ProjectXmxshtVo;
/**
* 天诚项目-销售及售后合同Mapper接口
*
* @author gaochunhu
* @date 2022-02-24
*/
public interface ProjectXmxshtMapper {
/**
* 查询天诚项目-销售及售后合同
*
* @param id 天诚项目-销售及售后合同ID
* @return 天诚项目-销售及售后合同
*/
ProjectXmxsht selectProjectXmxshtById(Long id);
/**
* 查询天诚项目-销售及售后合同列表
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 天诚项目-销售及售后合同集合
*/
List<ProjectXmxsht> selectProjectXmxshtList(ProjectXmxsht projectXmxsht);
/**
* 销售合同的 统计数和金额总计
*/
ProjectXmshtXhzjVo SelectXmxshtCount();
/**
* 查询天诚项目-销售及售后合同列表
*
* @param khid 客户负责人
* @return 天诚项目-销售及售后合同集合
*/
List<ProjectXmxshtVo> getXshtByKhid(@Param("khid") Long khid);
/**
* 新增天诚项目-销售及售后合同
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 结果
*/
int insertProjectXmxsht(ProjectXmxsht projectXmxsht);
/**
* 修改天诚项目-销售及售后合同
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 结果
*/
int updateProjectXmxsht(ProjectXmxsht projectXmxsht);
/**
* 删除天诚项目-销售及售后合同
*
* @param id 天诚项目-销售及售后合同ID
* @return 结果
*/
int deleteProjectXmxshtById(Long id);
/**
* 批量删除天诚项目-销售及售后合同
*
* @param ids 需要删除的数据ID
* @return 结果
*/
int deleteProjectXmxshtByIds(Long[] ids);
/**
* 通过商机id查询合同信息
*
* @param sjid 开票id
* @return
*/
List<ProjectXmxshtVo> getXshtBySjid(@Param("sjid") Long sjid);
BigDecimal getXshtje(Long xmid);
List<ProjectXmxsht> selectProjectXmxshtBySjid(Long sjid);
List<ProjectXmxsht> selectConfimXmxsht(ArapDetailsVo arapDetailsVo);
}
实现类取消传参
package com.lzy.project.project.service.impl;
import com.lzy.project.project.domain.ProjectXmht;
import com.lzy.project.project.domain.vo.ProjectXmhtVo;
import com.lzy.project.project.domain.vo.ProjectXmshtzjVo;
import com.lzy.project.project.mapper.ProjectXmhtMapper;
import com.lzy.project.project.service.IProjectXmhtService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 项目合同Service业务层处理
*
* @author gaochunhu
* @date 2021-09-18
*/
@Service
public class ProjectXmhtServiceImpl implements IProjectXmhtService {
@Resource
private ProjectXmhtMapper projectXmhtMapper;
/**
* 查询项目合同
*
* @param id 项目合同ID
* @return 项目合同
*/
@Override
public ProjectXmhtVo selectProjectXmhtById(Long id) {
return projectXmhtMapper.selectProjectXmhtById(id);
}
@Override
public ProjectXmhtVo selectProjectXmhtByHtbh(String htbh) {
return projectXmhtMapper.selectProjectXmhtByHtbh(htbh);
}
@Override
public List<ProjectXmhtVo> getXmcghtBySjid(ProjectXmhtVo projectXmht) {
return projectXmhtMapper.getXmcghtBySjid(projectXmht);
}
@Override
public List<ProjectXmhtVo> selectProjectXmhtByKhid(ProjectXmhtVo projectXmhtVo) {
return projectXmhtMapper.selectProjectXmhtByKhid(projectXmhtVo);
}
/**
* 查询项目合同列表
*
* @param projectXmht 项目合同
* @return 项目合同
*/
@Override
public List<ProjectXmhtVo> selectProjectXmhtList(ProjectXmht projectXmht) {
return projectXmhtMapper.selectProjectXmhtList(projectXmht);
}
@Override
public List<ProjectXmhtVo> getHtlistByXmId(ProjectXmhtVo projectXmhtVo) {
return projectXmhtMapper.getHtlistByXmId(projectXmhtVo);
}
/**
* 查询项目合同列表
*
* @param projectXmht
* @return
*/
@Override
public List<ProjectXmhtVo> getProjectXmhtList(ProjectXmhtVo projectXmht) {
return projectXmhtMapper.getProjectXmhtList(projectXmht);
}
/**
* 统计总记录数和金额统计
* @param
* @return
*/
@Override
public ProjectXmshtzjVo selectProjectXmshtCount() {
return projectXmhtMapper.SelectXmshtCount();
}
/**
* 新增项目合同
*
* @param projectXmht 项目合同
* @return 结果
*/
@Override
public int insertProjectXmht(ProjectXmht projectXmht) {
return projectXmhtMapper.insertProjectXmht(projectXmht);
}
/**
* 修改项目合同
*
* @param projectXmht 项目合同
* @return 结果
*/
@Override
public int updateProjectXmht(ProjectXmht projectXmht) {
return projectXmhtMapper.updateProjectXmht(projectXmht);
}
/**
* 批量删除项目合同
*
* @param ids 需要删除的项目合同ID
* @return 结果
*/
@Override
public int deleteProjectXmhtByIds(Long[] ids) {
return projectXmhtMapper.deleteProjectXmhtByIds(ids);
}
/**
* 删除项目合同信息
*
* @param id 项目合同ID
* @return 结果
*/
@Override
public int deleteProjectXmhtById(Long id) {
return projectXmhtMapper.deleteProjectXmhtById(id);
}
@Override
public List<ProjectXmhtVo> getProjectXmhtByIds(List<Long> htids, List<Long> hkids) {
return projectXmhtMapper.getProjectXmhtByIds(htids, hkids);
}
}
package com.lzy.project.project.service.impl;
import java.util.List;
import com.lzy.project.project.domain.vo.ProjectXmshtXhzjVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lzy.common.utils.DateUtils;
import com.lzy.project.project.domain.ProjectXmxsht;
import com.lzy.project.project.domain.vo.ProjectXmxshtVo;
import com.lzy.project.project.mapper.ProjectXmxshtMapper;
import com.lzy.project.project.service.IProjectXmxshtService;
import javax.annotation.Resource;
/**
* 天诚项目-销售及售后合同Service业务层处理
*
* @author gaochunhu
* @date 2022-02-24
*/
@Service
public class ProjectXmxshtServiceImpl implements IProjectXmxshtService {
@Resource
private ProjectXmxshtMapper projectXmxshtMapper;
/**
* 查询天诚项目-销售及售后合同
*
* @param id 天诚项目-销售及售后合同ID
* @return 天诚项目-销售及售后合同
*/
@Override
public ProjectXmxsht selectProjectXmxshtById(Long id) {
return projectXmxshtMapper.selectProjectXmxshtById(id);
}
/**
* 查询天诚项目-销售及售后合同列表
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 天诚项目-销售及售后合同
*/
@Override
public List<ProjectXmxsht> selectProjectXmxshtList(ProjectXmxsht projectXmxsht) {
return projectXmxshtMapper.selectProjectXmxshtList(projectXmxsht);
}
@Override
public List<ProjectXmxshtVo> getXshtByKhid(Long khid) {
return projectXmxshtMapper.getXshtByKhid(khid);
}
/**
* 总记录数 总计
*
* @param
*/
@Override
public ProjectXmshtXhzjVo selectProjectXmxshtCount() {
return projectXmxshtMapper.SelectXmxshtCount();
}
/**
* 新增天诚项目-销售及售后合同
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 结果
*/
@Override
public int insertProjectXmxsht(ProjectXmxsht projectXmxsht) {
projectXmxsht.setAddTime(DateUtils.getTime());
return projectXmxshtMapper.insertProjectXmxsht(projectXmxsht);
}
/**
* 修改天诚项目-销售及售后合同
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 结果
*/
@Override
public int updateProjectXmxsht(ProjectXmxsht projectXmxsht) {
projectXmxsht.setUpdateTime(DateUtils.getTime());
return projectXmxshtMapper.updateProjectXmxsht(projectXmxsht);
}
/**
* 批量删除天诚项目-销售及售后合同
*
* @param ids 需要删除的天诚项目-销售及售后合同ID
* @return 结果
*/
@Override
public int deleteProjectXmxshtByIds(Long[] ids) {
return projectXmxshtMapper.deleteProjectXmxshtByIds(ids);
}
/**
* 删除天诚项目-销售及售后合同信息
*
* @param id 天诚项目-销售及售后合同ID
* @return 结果
*/
@Override
public int deleteProjectXmxshtById(Long id) {
return projectXmxshtMapper.deleteProjectXmxshtById(id);
}
/**
* 通过商机id查询合同信息
*
* @param sjid 开票id
* @return
*/
@Override
public List<ProjectXmxshtVo> getXshtBySjid(Long sjid) {
return projectXmxshtMapper.getXshtBySjid(sjid);
}
}
service取消传参
package com.lzy.project.project.service;
import com.lzy.project.project.domain.ProjectXmht;
import com.lzy.project.project.domain.vo.ProjectXmhtVo;
import com.lzy.project.project.domain.vo.ProjectXmshtzjVo;
import java.util.List;
/**
* 项目合同Service接口
*
* @author gaochunhu
* @date 2021-09-18
*/
public interface IProjectXmhtService {
/**
* 查询项目合同
*
* @param id 项目合同ID
* @return 项目合同
*/
ProjectXmhtVo selectProjectXmhtById(Long id);
/**
* 查询项目合同
*
* @param htbh 项目合同ID
* @return 项目合同
*/
ProjectXmhtVo selectProjectXmhtByHtbh(String htbh);
/**
* 查询项目合同
*
* @param projectXmht
* @return 项目合同
*/
List<ProjectXmhtVo> getXmcghtBySjid(ProjectXmhtVo projectXmht);
/**
* 查询项目合同
*
* @param projectXmhtVo 客户id
* @return 项目合同
*/
List<ProjectXmhtVo> selectProjectXmhtByKhid(ProjectXmhtVo projectXmhtVo);
/**
* 查询项目合同列表
*
* @param projectXmht 项目合同
* @return 项目合同集合
*/
List<ProjectXmhtVo> selectProjectXmhtList(ProjectXmht projectXmht);
/**
* 根据项目id查询项目合同列表
*
* @param projectXmhtVo 项目合同
* @return 项目合同集合
*/
List<ProjectXmhtVo> getHtlistByXmId(ProjectXmhtVo projectXmhtVo);
/**
* 查询项目合同列表
*
* @param projectXmht
* @return
*/
List<ProjectXmhtVo> getProjectXmhtList(ProjectXmhtVo projectXmht);
/**
* 返回总记录数 和总计金额sum总计
* @param
* @return
*/
ProjectXmshtzjVo selectProjectXmshtCount();
/**
* 新增项目合同
*
* @param projectXmht 项目合同
* @return 结果
*/
int insertProjectXmht(ProjectXmht projectXmht);
/**
* 修改项目合同
*
* @param projectXmht 项目合同
* @return 结果
*/
int updateProjectXmht(ProjectXmht projectXmht);
/**
* 批量删除项目合同
*
* @param ids 需要删除的项目合同ID
* @return 结果
*/
int deleteProjectXmhtByIds(Long[] ids);
/**
* 删除项目合同信息
*
* @param id 项目合同ID
* @return 结果
*/
int deleteProjectXmhtById(Long id);
/**
* 查询项目合同列表
*
* @param htids 合同id
* @param hkids 回款id
* @return
*/
List<ProjectXmhtVo> getProjectXmhtByIds(List<Long> htids, List<Long> hkids);
}
package com.lzy.project.project.service;
import java.util.List;
import com.lzy.project.project.domain.ProjectXmxsht;
import com.lzy.project.project.domain.vo.ProjectXmshtXhzjVo;
import com.lzy.project.project.domain.vo.ProjectXmxshtVo;
/**
* 天诚项目-销售及售后合同Service接口
*
* @author gaochunhu
* @date 2022-02-24
*/
public interface IProjectXmxshtService {
/**
* 查询天诚项目-销售及售后合同
*
* @param id 天诚项目-销售及售后合同ID
* @return 天诚项目-销售及售后合同
*/
ProjectXmxsht selectProjectXmxshtById(Long id);
/**
* 查询天诚项目-销售及售后合同列表
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 天诚项目-销售及售后合同集合
*/
List<ProjectXmxsht> selectProjectXmxshtList(ProjectXmxsht projectXmxsht);
/**
* 查询天诚项目-销售及售后合同列表
*
* @param khid 客户负责人
* @return 天诚项目-销售及售后合同集合
*/
List<ProjectXmxshtVo> getXshtByKhid(Long khid);
/**
* 总记录数 总计 sum总计
*/
ProjectXmshtXhzjVo selectProjectXmxshtCount();
/**
* 新增天诚项目-销售及售后合同
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 结果
*/
int insertProjectXmxsht(ProjectXmxsht projectXmxsht);
/**
* 修改天诚项目-销售及售后合同
*
* @param projectXmxsht 天诚项目-销售及售后合同
* @return 结果
*/
int updateProjectXmxsht(ProjectXmxsht projectXmxsht);
/**
* 批量删除天诚项目-销售及售后合同
*
* @param ids 需要删除的天诚项目-销售及售后合同ID
* @return 结果
*/
int deleteProjectXmxshtByIds(Long[] ids);
/**
* 删除天诚项目-销售及售后合同信息
*
* @param id 天诚项目-销售及售后合同ID
* @return 结果
*/
int deleteProjectXmxshtById(Long id);
/**
* 通过商机id查询合同信息
*
* @param sjid 开票id
* @return
*/
List<ProjectXmxshtVo> getXshtBySjid(Long sjid);
}
xml进行取两位整数
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzy.project.project.mapper.ProjectXmhtMapper">
<resultMap type="ProjectXmhtVo" id="ProjectXmhtResult">
<result property="id" column="id"/>
<result property="oahtid" column="oahtid"/>
<result property="sjid" column="sjid"/>
<result property="htmc" column="htmc"/>
<result property="htbh" column="htbh"/>
<result property="htnr" column="htnr"/>
<result property="qyf" column="qyf"/>
<result property="qysj" column="qysj"/>
<result property="htje" column="htje"/>
<result property="yzf" column="yzf"/>
<result property="dzf" column="dzf"/>
<result property="wzf" column="wzf"/>
<result property="qyr" column="qyr"/>
<result property="ssr" column="ssr"/>
<result property="htlx" column="htlx"/>
<result property="htlxmc" column="htlxmc"/>
<result property="ssbm" column="ssbm"/>
<result property="xmfzr" column="xmfzr"/>
<result property="cgfs" column="cgfs"/>
<result property="cgfsmc" column="cgfsmc"/>
<result property="rjje" column="rjje"/>
<result property="yjje" column="yjje"/>
<result property="fkfs" column="fkfs"/>
<result property="fkfsmc" column="fkfsmc"/>
<result property="jf" column="jf"/>
<result property="htfj" column="htfj"/>
<result property="xmmc" column="xmmc"/>
<result property="ssbmmc" column="ssbmmc"/>
<result property="ssrmc" column="ssrmc"/>
<result property="xmfzrmc" column="xmfzrmc"/>
<result property="qyrmc" column="qyrmc"/>
<result property="glryjsl" column="glryjsl"/>
<result property="swfzrmc" column="swfzrmc"/>
<result property="fwje" column="fwje"/>
<result property="sgje" column="sgje"/>
<result property="sfzjl" column="sfzjl"/>
<result property="spje" column="spje"/>
</resultMap>
<sql id="selectProjectXmhtVo">
select a.`id`,
a.`oahtid`,
a.`sjid`,
a.`htmc`,
a.`htbh`,
a.`htnr`,
a.`qyf`,
a.`qysj`,
ifnull (a.`htje`, 0) as htje,
a.`yzf`,
a.`dzf`,
a.`wzf`,
a.`qyr`,
a.`ssr`,
a.`htlx`,
a.`htlxmc`,
a.`ssbm`,
a.`xmfzr`,
a.`cgfs`,
a.`cgfsmc`,
a.`rjje`,
a.`yjje`,
a.`fkfs`,
a.`fkfsmc`,
a.`jf`,
a.`htfj`,
a.sgje,
fwje,
b.xmmc,
c.dept_name as ssbmmc,
(select c.nick_name from sys_user c where c.user_id = a.qyr) as qyrmc,
(select c.nick_name from sys_user c where c.user_id = a.ssr) as ssrmc,
(select c.nick_name from sys_user c where c.user_id = a.xmfzr) as xmfzrmc
from project_xmcght a
left join project_xmgl b
on a.sjid = b.sjid
left join sys_dept c
on a.ssbm = c.dept_id
</sql>
<select id="SelectXmshtCount" resultType="ProjectXmshtzjVo">
select count(1) as htslzj,
Round( IFNULL(SUM(a.htje), 0), 2 ) as htjetj,
Round( IFNULL(SUM(a.yzf), 0), 2) as yzfzj,
Round( IFNULL(SUM(a.wzf), 0),2) as wzfzj
from project_xmcght a
</select>
<select id="selectProjectXmhtList" parameterType="ProjectXmht" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
<where>
<if test="oahtid != null ">and a.oahtid = #{oahtid}</if>
<if test="sjid != null ">and a.sjid = #{sjid}</if>
<if test="htmc != null and htmc != ''">and htmc like '%${htmc}%'</if>
<if test="htbh != null and htbh != ''">and a.htbh like concat('%', #{htbh}, '%')</if>
<if test="htnr != null and htnr != ''">and a.htnr = #{htnr}</if>
<if test="qyf != null and qyf != ''">and a.qyf = #{qyf}</if>
<if test="qysj != null and qysj != ''">and a.qysj = #{qysj}</if>
<if test="htje != null and htje != ''">and a.htje = #{htje}</if>
<if test="yzf != null ">and a.yzf = #{yzf}</if>
<if test="dzf != null ">and a.dzf = #{dzf}</if>
<if test="wzf != null ">and a.wzf = #{wzf}</if>
<if test="qyr != null ">and a.qyr = #{qyr}</if>
<if test="ssr != null and ssr != ''">and a.ssr = #{ssr}</if>
<if test="htlx != null and htlx == 0">and (a.htlx = 0 or a.htlx is null)</if>
<if test="htlx != null and htlx == 1">and (a.htlx = 1)</if>
<if test="htlx != null and htlx == 2">and (a.htlx = 2)</if>
<if test="htlxmc != null and htlxmc != ''">and a.htlxmc = #{htlxmc}</if>
<if test="ssbm != null ">and a.ssbm = #{ssbm}</if>
<if test="xmfzr != null ">and a.xmfzr = #{xmfzr}</if>
<if test="cgfs != null ">and a.cgfs = #{cgfs}</if>
<if test="cgfsmc != null and cgfsmc != ''">and a.cgfsmc = #{cgfsmc}</if>
<if test="rjje != null ">and a.rjje = #{rjje}</if>
<if test="yjje != null ">and a.yjje = #{yjje}</if>
<if test="fkfs != null ">and a.fkfs = #{fkfs}</if>
<if test="fkfsmc != null and fkfsmc != ''">and a.fkfsmc = #{fkfsmc}</if>
<if test="jf != null and jf != ''">and a.jf = #{jf}</if>
<if test="htfj != null and htfj != ''">and a.htfj = #{htfj}</if>
</where>
ORDER BY id desc
</select>
<select id="getHtlistByXmId" parameterType="ProjectXmhtVo" resultMap="ProjectXmhtResult">
select a.`id`,
a.`oahtid`,
a.`sjid`,
a.`htmc`,
a.`htbh`,
a.`htnr`,
a.`qyf`,
a.`qysj`,
ifnull(a.`htje`, 0) as htje,
a.`yzf`,
a.`dzf`,
a.`wzf`,
a.`qyr`,
a.`ssr`,
a.`htlx`,
a.`htlxmc`,
a.`ssbm`,
a.`xmfzr`,
a.`cgfs`,
a.`cgfsmc`,
a.`rjje`,
a.`yjje`,
a.`fkfs`,
a.`fkfsmc`,
a.`jf`,
a.`htfj`,
a.sgje,
fwje,
b.xmmc,
c.dept_name as ssbmmc,
(select c.nick_name from sys_user c where c.user_id = a.qyr) as qyrmc,
(select c.nick_name from sys_user c where c.user_id = a.ssr) as ssrmc,
(select c.nick_name from sys_user c where c.user_id = a.xmfzr) as xmfzrmc
from project_xmcght a
left join project_xmgl b
on a.sjid = b.sjid
left join sys_dept c
on a.ssbm = c.dept_id
where b.id=#{xmid}
<if test="htmc != null and htmc != ''">and a.htmc like '%${htmc}%'</if>
</select>
<select id="selectProjectXmhtById" parameterType="Long" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
where a.id = #{id}
</select>
<select id="selectProjectXmhtByKhid" parameterType="ProjectXmhtVo" resultMap="ProjectXmhtResult">
select a.*,
(select c.nick_name from sys_user c where c.user_id = a.xmfzr) as xmfzrmc,
b.xmmc,
(select c.nick_name from sys_user c where c.user_id = b.swfzr) as swfzrmc
from project_xmcght a,
project_xmgl b
where a.sjid = b.sjid
and b.khid = #{khid}
</select>
<select id="selectProjectXmhtByHtbh" parameterType="String" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
where FIND_IN_SET(a.htbh,#{htbh}) limit 1
</select>
<select id="getXmcghtBySjid" parameterType="ProjectXmhtVo" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
where a.sjid = #{sjid}
<if test="htmc != null and htmc != ''">and htmc like '%${htmc}%'</if>
<if test="htbh != null and htbh != ''">and htbh like '%${htbh}%'</if>
<if test="xmfzrmc != null and xmfzrmc != ''">and a.xmfzr in (select user_id from sys_user where nick_name like
'%${xmfzrmc}%')
</if>
<if test="ssrmc != null and ssrmc != ''">and a.ssr in (select user_id from sys_user where nick_name like
'%${ssrmc}%')
</if>
<if test="htjeStart != null ">and a.htje >= #{htjeStart}</if>
<if test="htjeEnd != null ">and a.htje <= #{htjeEnd}</if>
</select>
<insert id="insertProjectXmht" parameterType="ProjectXmht" useGeneratedKeys="true" keyProperty="id">
insert into project_xmcght
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="oahtid != null ">oahtid,</if>
<if test="sjid != null ">sjid,</if>
<if test="htmc != null and htmc != ''">htmc,</if>
<if test="htbh != null and htbh != ''">htbh,</if>
<if test="htnr != null and htnr != ''">htnr,</if>
<if test="qyf != null and qyf != ''">qyf,</if>
<if test="qysj != null and qysj != ''">qysj,</if>
<if test="htje != null and htje != ''">htje,</if>
<if test="yzf != null ">yzf,</if>
<if test="dzf != null ">dzf,</if>
<if test="wzf != null ">wzf,</if>
<if test="qyr != null ">qyr,</if>
<if test="ssr != null and ssr != ''">ssr,</if>
<if test="htlx != null ">htlx,</if>
<if test="htlxmc != null and htlxmc != ''">htlxmc,</if>
<if test="ssbm != null ">ssbm,</if>
<if test="xmfzr != null ">xmfzr,</if>
<if test="cgfs != null ">cgfs,</if>
<if test="cgfsmc != null and cgfsmc != ''">cgfsmc,</if>
<if test="rjje != null ">rjje,</if>
<if test="yjje != null ">yjje,</if>
<if test="fkfs != null ">fkfs,</if>
<if test="fkfsmc != null and fkfsmc != ''">fkfsmc,</if>
<if test="jf != null and jf != ''">jf,</if>
<if test="htfj != null and htfj != ''">htfj,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="oahtid != null ">#{oahtid},</if>
<if test="sjid != null ">#{sjid},</if>
<if test="htmc != null and htmc != ''">#{htmc},</if>
<if test="htbh != null and htbh != ''">#{htbh},</if>
<if test="htnr != null and htnr != ''">#{htnr},</if>
<if test="qyf != null and qyf != ''">#{qyf},</if>
<if test="qysj != null and qysj != ''">#{qysj},</if>
<if test="htje != null and htje != ''">#{htje},</if>
<if test="yzf != null ">#{yzf},</if>
<if test="dzf != null ">#{dzf},</if>
<if test="wzf != null ">#{wzf},</if>
<if test="qyr != null ">#{qyr},</if>
<if test="ssr != null and ssr != ''">#{ssr},</if>
<if test="htlx != null ">#{htlx},</if>
<if test="htlxmc != null and htlxmc != ''">#{htlxmc},</if>
<if test="ssbm != null ">#{ssbm},</if>
<if test="xmfzr != null ">#{xmfzr},</if>
<if test="cgfs != null ">#{cgfs},</if>
<if test="cgfsmc != null and cgfsmc != ''">#{cgfsmc},</if>
<if test="rjje != null ">#{rjje},</if>
<if test="yjje != null ">#{yjje},</if>
<if test="fkfs != null ">#{fkfs},</if>
<if test="fkfsmc != null and fkfsmc != ''">#{fkfsmc},</if>
<if test="jf != null and jf != ''">#{jf},</if>
<if test="htfj != null and htfj != ''">#{htfj},</if>
</trim>
</insert>
<update id="updateProjectXmht" parameterType="ProjectXmht">
update project_xmcght
<trim prefix="SET" suffixOverrides=",">
<if test="oahtid != null ">oahtid = #{oahtid},</if>
<if test="sjid != null ">sjid = #{sjid},</if>
<if test="htmc != null and htmc != ''">htmc = #{htmc},</if>
<if test="htbh != null and htbh != ''">htbh = #{htbh},</if>
<if test="htnr != null and htnr != ''">htnr = #{htnr},</if>
<if test="qyf != null and qyf != ''">qyf = #{qyf},</if>
<if test="qysj != null and qysj != ''">qysj = #{qysj},</if>
<if test="htje != null and htje != ''">htje = #{htje},</if>
<if test="yzf != null ">yzf = #{yzf},</if>
<if test="dzf != null ">dzf = #{dzf},</if>
<if test="wzf != null ">wzf = #{wzf},</if>
<if test="qyr != null ">qyr = #{qyr},</if>
<if test="ssr != null and ssr != ''">ssr = #{ssr},</if>
<if test="htlx != null ">htlx = #{htlx},</if>
<if test="htlxmc != null and htlxmc != ''">htlxmc = #{htlxmc},</if>
<if test="ssbm != null ">ssbm = #{ssbm},</if>
<if test="xmfzr != null ">xmfzr = #{xmfzr},</if>
<if test="cgfs != null ">cgfs = #{cgfs},</if>
<if test="cgfsmc != null and cgfsmc != ''">cgfsmc = #{cgfsmc},</if>
<if test="rjje != null ">rjje = #{rjje},</if>
<if test="yjje != null ">yjje = #{yjje},</if>
<if test="fkfs != null ">fkfs = #{fkfs},</if>
<if test="fkfsmc != null and fkfsmc != ''">fkfsmc = #{fkfsmc},</if>
<if test="jf != null and jf != ''">jf = #{jf},</if>
<if test="htfj != null and htfj != ''">htfj = #{htfj},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProjectXmhtById" parameterType="Long">
delete
from project_xmcght
where id = #{id}
</delete>
<delete id="deleteProjectXmhtByIds" parameterType="String">
delete from project_xmcght where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<sql id="getProjectXmhtVo">
select id,
oahtid,
sjid,
htmc,
htbh,
htnr,
qyf,
qysj,
htje,
yzf,
dzf,
wzf,
qyr,
(select c.nick_name from sys_user c where c.user_id = qyr) as qyrmc,
ssr,
htlx,
htlxmc,
ssbm,
xmfzr,
cgfs,
cgfsmc,
rjje,
yjje,
fkfs,
fkfsmc,
jf,
htfj,
(select count(g.zyid) from project_ryjzycgjl as g where g.cgjlid = oahtid) as glryjsl
from project_xmcght
</sql>
<select id="getProjectXmhtList" parameterType="ProjectXmht" resultMap="ProjectXmhtResult">
select a.id,
a.oahtid,
a.sjid,
a.htmc,
a.htbh,
a.htnr,
a.qyf,
a.qysj,
a.htje,
(select if(f.fkzt='1', sum(f.fkje), 0) FROM project_fkgl f WHERE f.sjid = a.sjid AND f.htbh = a.htbh) as yzf,
(select if(f.fkzt='0', sum(f.fkje), 0) FROM project_fkgl f WHERE f.sjid = a.sjid AND f.htbh = a.htbh) as dzf,
if((
a.htje -
(select if(f.fkzt='1', sum(f.fkje), 0) FROM project_fkgl f WHERE f.sjid = a.sjid AND f.htbh = a.htbh) -
(select if(f.fkzt='0', sum(f.fkje), 0) FROM project_fkgl f WHERE f.sjid = a.sjid AND f.htbh = a.htbh)
) > 0,
(
a.htje -
(select if(f.fkzt='1', sum(f.fkje), 0) FROM project_fkgl f WHERE f.sjid = a.sjid AND f.htbh = a.htbh) -
(select if(f.fkzt='0', sum(f.fkje), 0) FROM project_fkgl f WHERE f.sjid = a.sjid AND f.htbh = a.htbh)
), 0)
as wzf,
a.qyr,
(select c.nick_name from sys_user c where c.user_id = qyr) as qyrmc,
a.ssr,
a.htlx,
a.htlxmc,
a.ssbm,
a.xmfzr,
a.cgfs,
a.cgfsmc,
a.rjje,
a.yjje,
a.fkfs,
a.fkfsmc,
a.jf,
a.htfj,
(select count(g.zyid) from project_ryjzycgjl as g where g.cgjlid = oahtid) as glryjsl,
IFNULL(s.spje,0) as spje
from project_xmcght AS a
LEFT JOIN project_spgl as s
on s.sjid = a.sjid and s.htid = a.id
<where>
<if test="oahtid != null ">and a.oahtid = #{oahtid}</if>
<if test="sjid != null ">and a.sjid = #{sjid}</if>
<if test="htmc != null and htmc != ''">and a.htmc = #{htmc}</if>
<if test="htbh != null and htbh != ''">and a.htbh = #{htbh}</if>
<if test="htnr != null and htnr != ''">and a.htnr = #{htnr}</if>
<if test="qyf != null and qyf != ''">and a.qyf = #{qyf}</if>
<if test="qysj != null and qysj != ''">and a.qysj = #{qysj}</if>
<if test="htje != null and htje != ''">and a.htje = #{htje}</if>
<if test="dzf != null ">and a.dzf = #{dzf}</if>
<if test="wzf != null ">and a.wzf = #{wzf}</if>
<if test="qyr != null ">and a.qyr = #{qyr}</if>
<if test="ssr != null and ssr != ''">and a.ssr = #{ssr}</if>
<if test="htlx != null ">and a.htlx = #{htlx}</if>
<if test="htlxmc != null and htlxmc != ''">and a.htlxmc = #{htlxmc}</if>
<if test="ssbm != null ">and a.ssbm = #{ssbm}</if>
<if test="xmfzr != null ">and a.xmfzr = #{xmfzr}</if>
<if test="cgfs != null ">and a.cgfs = #{cgfs}</if>
<if test="cgfsmc != null and cgfsmc != ''">and a.cgfsmc = #{cgfsmc}</if>
<if test="rjje != null ">and a.rjje = #{rjje}</if>
<if test="yjje != null ">and a.yjje = #{yjje}</if>
<if test="fkfs != null ">and a.fkfs = #{fkfs}</if>
<if test="fkfsmc != null and fkfsmc != ''">and a.fkfsmc = #{fkfsmc}</if>
<if test="jf != null and jf != ''">and a.jf = #{jf}</if>
<if test="htfj != null and htfj != ''">and a.htfj = #{htfj}</if>
</where>
</select>
<select id="getProjectXmhtByIds" parameterType="Long" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
<where>
<if test="htids != null and htids.size > 0 ">
a.id in
<foreach item="item" index="index" collection="htids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="hkids != null and hkids.size > 0 ">and a.id in (select htid from project_kpgl where id in (
select kp_id from project_hkkp where hk_id in
<foreach item="item" index="index" collection="hkids" open="(" separator="," close=")">
#{item}
</foreach>
))
</if>
</where>
</select>
<select id="getProjectXmcghtBySjid" parameterType="Long" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
where a.sjid = #{sjid}
</select>
<select id="getConfimXmcght" parameterType="ArapDetailsVo" resultMap="ProjectXmhtResult">
<include refid="selectProjectXmhtVo"/>
where a.sjid = #{sjid}
and a.qysj >= #{qrsj}
</select>
<insert id="insertCght" parameterType="PurchaseCgdHtAddVo" useGeneratedKeys="true" keyProperty="id">
insert into project_xmcght
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="oahtid != null ">oahtid,</if>
<if test="sjid != null ">sjid,</if>
<if test="htmc != null and htmc != ''">htmc,</if>
<if test="htbh != null and htbh != ''">htbh,</if>
<if test="htnr != null and htnr != ''">htnr,</if>
<if test="qyf != null and qyf != ''">qyf,</if>
<if test="qysj != null and qysj != ''">qysj,</if>
<if test="htje != null and htje != ''">htje,</if>
<if test="yzf != null ">yzf,</if>
<if test="dzf != null ">dzf,</if>
<if test="wzf != null ">wzf,</if>
<if test="qyr != null ">qyr,</if>
<if test="ssr != null and ssr != ''">ssr,</if>
<if test="htlx != null ">htlx,</if>
<if test="htlxmc != null and htlxmc != ''">htlxmc,</if>
<if test="ssbm != null ">ssbm,</if>
<if test="xmfzr != null ">xmfzr,</if>
<if test="cgfs != null ">cgfs,</if>
<if test="cgfsmc != null and cgfsmc != ''">cgfsmc,</if>
<if test="rjje != null ">rjje,</if>
<if test="yjje != null ">yjje,</if>
<if test="fkfs != null ">fkfs,</if>
<if test="fkfsmc != null and fkfsmc != ''">fkfsmc,</if>
<if test="jf != null and jf != ''">jf,</if>
<if test="htfj != null and htfj != ''">htfj,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="oahtid != null ">#{oahtid},</if>
<if test="sjid != null ">#{sjid},</if>
<if test="htmc != null and htmc != ''">#{htmc},</if>
<if test="htbh != null and htbh != ''">#{htbh},</if>
<if test="htnr != null and htnr != ''">#{htnr},</if>
<if test="qyf != null and qyf != ''">#{qyf},</if>
<if test="qysj != null and qysj != ''">#{qysj},</if>
<if test="htje != null and htje != ''">#{htje},</if>
<if test="yzf != null ">#{yzf},</if>
<if test="dzf != null ">#{dzf},</if>
<if test="wzf != null ">#{wzf},</if>
<if test="qyr != null ">#{qyr},</if>
<if test="ssr != null and ssr != ''">#{ssr},</if>
<if test="htlx != null ">#{htlx},</if>
<if test="htlxmc != null and htlxmc != ''">#{htlxmc},</if>
<if test="ssbm != null ">#{ssbm},</if>
<if test="xmfzr != null ">#{xmfzr},</if>
<if test="cgfs != null ">#{cgfs},</if>
<if test="cgfsmc != null and cgfsmc != ''">#{cgfsmc},</if>
<if test="rjje != null ">#{rjje},</if>
<if test="yjje != null ">#{yjje},</if>
<if test="fkfs != null ">#{fkfs},</if>
<if test="fkfsmc != null and fkfsmc != ''">#{fkfsmc},</if>
<if test="jf != null and jf != ''">#{jf},</if>
<if test="htfj != null and htfj != ''">#{htfj},</if>
</trim>
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzy.project.project.mapper.ProjectXmxshtMapper">
<resultMap type="ProjectXmxshtVo" id="ProjectXmxshtResult">
<result property="id" column="id"/>
<result property="sjid" column="sjid"/>
<result property="htxmmc" column="htxmmc"/>
<result property="htkhmc" column="htkhmc"/>
<result property="htje" column="htje"/>
<result property="ysje" column="ysje"/>
<result property="ysjei" column="ysjei"/>
<result property="ykfp" column="ykfp"/>
<result property="qdrq" column="qdrq"/>
<result property="htlb" column="htlb"/>
<result property="xmlx" column="xmlx"/>
<result property="wfqygs" column="wfqygs"/>
<result property="addUser" column="add_user"/>
<result property="addTime" column="add_time"/>
<result property="updateUser" column="update_user"/>
<result property="updateTime" column="update_time"/>
<result property="sjmc" column="sjmc"/>
<result property="xsfzrmc" column="xsfzrmc"/>
<result property="xmjlmc" column="xmjlmc"/>
<result property="xmid" column="xmid"/>
<result property="htbh" column="htbh"/>
</resultMap>
<sql id="selectProjectXmxshtVo">
select id,
sjid,
htxmmc,
htkhmc,
htje,
ysje,
ysjei,
ykfp,
qdrq,
htlb,
xmlx,
wfqygs,
htbh,
add_user,
add_time,
update_user,
update_time
from project_xmxsht
</sql>
<select id="SelectXmxshtCount" resultType="ProjectXmshtXhzjVo">
SELECT
count( 1 ) AS htzj,
Round( IFNULL( SUM( htje ), 0 ), 2 ) AS htjezj,
Round( IFNULL( SUM( ysje ), 0 ), 2 ) AS ysjezj,
Round( IFNULL( SUM( ysjei ), 0 ),2 ) AS ysjeizj
FROM
project_xmxsht
WHERE
ly = 'OA'
AND ( sfyx IS NULL OR sfyx = '0' )
</select>
<select id="selectProjectXmxshtList" parameterType="ProjectXmxsht" resultMap="ProjectXmxshtResult">
<include refid="selectProjectXmxshtVo"/>
<where>
ly = 'OA'
AND(sfyx is null OR sfyx = '0')
<if test="sjid != null ">and sjid = #{sjid}</if>
<if test="htxmmc != null and htxmmc != ''">and htxmmc like concat('%', #{htxmmc}, '%')</if>
<if test="htkhmc != null and htkhmc != ''">and htkhmc like concat('%', #{htkhmc}, '%')</if>
<if test="htje != null and htje != ''">and htje = #{htje}</if>
<if test="ysje != null and ysje != ''">and ysje = #{ysje}</if>
<if test="ysjei != null and ysjei != ''">and ysjei = #{ysjei}</if>
<if test="ykfp != null and ykfp != ''">and ykfp = #{ykfp}</if>
<if test="qdrq != null and qdrq != ''">and qdrq = #{qdrq}</if>
<if test="htlb != null and htlb != ''">and htlb = #{htlb}</if>
<if test="xmlx != null and xmlx != ''">and xmlx = #{xmlx}</if>
<if test="wfqygs != null and wfqygs != ''">and wfqygs = #{wfqygs}</if>
<if test="addUser != null ">and add_user = #{addUser}</if>
<if test="addTime != null and addTime != ''">and add_time = #{addTime}</if>
<if test="updateUser != null ">and update_user = #{updateUser}</if>
</where>
ORDER BY id desc
</select>
<select id="selectProjectXmxshtById" parameterType="Long" resultMap="ProjectXmxshtResult">
<include refid="selectProjectXmxshtVo"/>
where id = #{id}
</select>
<insert id="insertProjectXmxsht" parameterType="ProjectXmxsht" useGeneratedKeys="true" keyProperty="id">
insert into project_xmxsht
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sjid != null ">sjid,</if>
<if test="htxmmc != null and htxmmc != ''">htxmmc,</if>
<if test="htkhmc != null and htkhmc != ''">htkhmc,</if>
<if test="htje != null and htje != ''">htje,</if>
<if test="ysje != null and ysje != ''">ysje,</if>
<if test="ysjei != null and ysjei != ''">ysjei,</if>
<if test="ykfp != null and ykfp != ''">ykfp,</if>
<if test="qdrq != null and qdrq != ''">qdrq,</if>
<if test="htlb != null and htlb != ''">htlb,</if>
<if test="xmlx != null and xmlx != ''">xmlx,</if>
<if test="wfqygs != null and wfqygs != ''">wfqygs,</if>
<if test="addUser != null ">add_user,</if>
<if test="addTime != null and addTime != ''">add_time,</if>
<if test="updateUser != null ">update_user,</if>
<if test="updateTime != null and updateTime != ''">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sjid != null ">#{sjid},</if>
<if test="htxmmc != null and htxmmc != ''">#{htxmmc},</if>
<if test="htkhmc != null and htkhmc != ''">#{htkhmc},</if>
<if test="htje != null and htje != ''">#{htje},</if>
<if test="ysje != null and ysje != ''">#{ysje},</if>
<if test="ysjei != null and ysjei != ''">#{ysjei},</if>
<if test="ykfp != null and ykfp != ''">#{ykfp},</if>
<if test="qdrq != null and qdrq != ''">#{qdrq},</if>
<if test="htlb != null and htlb != ''">#{htlb},</if>
<if test="xmlx != null and xmlx != ''">#{xmlx},</if>
<if test="wfqygs != null and wfqygs != ''">#{wfqygs},</if>
<if test="addUser != null ">#{addUser},</if>
<if test="addTime != null and addTime != ''">#{addTime},</if>
<if test="updateUser != null ">#{updateUser},</if>
<if test="updateTime != null and updateTime != ''">#{updateTime},</if>
</trim>
</insert>
<update id="updateProjectXmxsht" parameterType="ProjectXmxsht">
update project_xmxsht
<trim prefix="SET" suffixOverrides=",">
<if test="sjid != null ">sjid = #{sjid},</if>
<if test="htxmmc != null and htxmmc != ''">htxmmc = #{htxmmc},</if>
<if test="htkhmc != null and htkhmc != ''">htkhmc = #{htkhmc},</if>
<if test="htje != null and htje != ''">htje = #{htje},</if>
<if test="ysje != null and ysje != ''">ysje = #{ysje},</if>
<if test="ysjei != null and ysjei != ''">ysjei = #{ysjei},</if>
<if test="ykfp != null and ykfp != ''">ykfp = #{ykfp},</if>
<if test="qdrq != null and qdrq != ''">qdrq = #{qdrq},</if>
<if test="htlb != null and htlb != ''">htlb = #{htlb},</if>
<if test="xmlx != null and xmlx != ''">xmlx = #{xmlx},</if>
<if test="wfqygs != null and wfqygs != ''">wfqygs = #{wfqygs},</if>
<if test="addUser != null ">add_user = #{addUser},</if>
<if test="addTime != null and addTime != ''">add_time = #{addTime},</if>
<if test="updateUser != null ">update_user = #{updateUser},</if>
<if test="updateTime != null and updateTime != ''">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProjectXmxshtById" parameterType="Long">
delete
from project_xmxsht
where id = #{id}
</delete>
<delete id="deleteProjectXmxshtByIds" parameterType="String">
delete from project_xmxsht where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getXshtByKhid" parameterType="Long" resultMap="ProjectXmxshtResult">
select a.id,
a.sjid,
a.htxmmc,
a.htkhmc,
a.htje,
a.ysje,
a.ysjei,
a.ykfp,
a.qdrq,
a.htlb,
a.xmlx,
b.sjmc,
b.dqjd,
c.id as xmid,
(select u.nick_name from sys_user u where u.user_id = b.sjssr) as xsfzrmc,
(select u.nick_name from sys_user u where u.user_id = c.xmjl) as xmjlmc
from project_xmxsht a
left join ope_sjgl b on a.sjid = b.id
left join project_xmgl c on b.id = c.sjid
where a.sjid in (select id from ope_sjgl where glkh = #{khid})
and (a.ly is null or a.ly != 'OA')
</select>
<select id="getXshtBySjid" parameterType="Long" resultMap="ProjectXmxshtResult">
select id,
sjid,
htxmmc,
htkhmc,
htje,
ysje,
ysjei,
ykfp,
qdrq,
htlb,
xmlx,
wfqygs,
add_user,
add_time,
update_user,
update_time
from project_xmxsht
where sjid = #{sjid}
and (ly is null or ly != 'OA')
</select>
<select id="getXshtje" parameterType="Long" resultType="BigDecimal">
SELECT IFNULL(SUM(s.htje), 0)
FROM project_xmxsht s
LEFT JOIN project_xmgl AS g ON g.sjid = s.sjid
WHERE g.id = #{xmid}
</select>
<select id="selectProjectXmxshtBySjid" parameterType="Long" resultMap="ProjectXmxshtResult">
<include refid="selectProjectXmxshtVo"/>
where
ly = 'OA'
AND(sfyx is null OR sfyx = '0')
and sjid = #{sjid}
</select>
<select id="selectConfimXmxsht" parameterType="ArapDetailsVo" resultMap="ProjectXmxshtResult">
<include refid="selectProjectXmxshtVo"/>
where
ly = 'OA'
AND(sfyx is null OR sfyx = '0')
and sjid = #{sjid}
and qdrq >= #{qrsj}
</select>
</mapper>