Commit 03d515cf by jiang'yun

修改问题

parent 724f862c
package com.qianhe.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.domain.SjFybp;
import com.qianhe.service.ISjFybpService;
import com.qianhe.common.utils.poi.ExcelUtil;
import com.qianhe.common.core.page.TableDataInfo;
/**
* 三基-费用报批Controller
*
* @author qianhe
* @date 2024-07-05
*/
@RestController
@RequestMapping("/system/sjFybp")
public class SjFybpController extends BaseController
{
@Autowired
private ISjFybpService sjFybpService;
/**
* 查询三基-费用报批列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFybp:list')")
@GetMapping("/list")
public TableDataInfo list(SjFybp sjFybp)
{
startPage();
List<SjFybp> list = sjFybpService.selectSjFybpList(sjFybp);
return getDataTable(list);
}
/**
* 导出三基-费用报批列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFybp:export')")
@Log(title = "三基-费用报批", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjFybp sjFybp)
{
List<SjFybp> list = sjFybpService.selectSjFybpList(sjFybp);
ExcelUtil<SjFybp> util = new ExcelUtil<SjFybp>(SjFybp.class);
util.exportExcel(response, list, "三基-费用报批数据");
}
/**
* 获取三基-费用报批详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sjFybp:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjFybpService.selectSjFybpById(id));
}
/**
* 新增三基-费用报批
*/
@PreAuthorize("@ss.hasPermi('system:sjFybp:add')")
@Log(title = "三基-费用报批", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjFybp sjFybp)
{
return toAjax(sjFybpService.insertSjFybp(sjFybp));
}
/**
* 修改三基-费用报批
*/
@PreAuthorize("@ss.hasPermi('system:sjFybp:edit')")
@Log(title = "三基-费用报批", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjFybp sjFybp)
{
return toAjax(sjFybpService.updateSjFybp(sjFybp));
}
/**
* 删除三基-费用报批
*/
@PreAuthorize("@ss.hasPermi('system:sjFybp:remove')")
@Log(title = "三基-费用报批", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjFybpService.deleteSjFybpByIds(ids));
}
/**
* 提交或审批
*/
// @PreAuthorize("@ss.hasPermi('system:sjFybp:tj')")
@Log(title = "三基-费用报批", businessType = BusinessType.UPDATE)
@PostMapping("/tj")
public AjaxResult tj(@RequestBody SjFybp sjFybp)
{
return toAjax(sjFybpService.tj(sjFybp));
}
/**
* 查询三基-费用报批列表
*/
@GetMapping("/splist")
public TableDataInfo splist(SjFybp sjFybp)
{
startPage();
List<SjFybp> list = sjFybpService.selectSjFybpList(sjFybp);
return getDataTable(list);
}
/**
* 费用维护
*/
// @PreAuthorize("@ss.hasPermi('system:sjFybp:fywh')")
@Log(title = "三基-费用报批", businessType = BusinessType.UPDATE)
@PostMapping("fywh")
public AjaxResult fywh(@RequestBody SjFybp sjFybp)
{
return toAjax(sjFybpService.fywh(sjFybp));
}
}
package com.qianhe.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.domain.SjFybpWh;
import com.qianhe.service.ISjFybpWhService;
import com.qianhe.common.utils.poi.ExcelUtil;
import com.qianhe.common.core.page.TableDataInfo;
/**
* 三基-费用维护Controller
*
* @author qianhe
* @date 2024-07-05
*/
@RestController
@RequestMapping("/system/sjFybpWh")
public class SjFybpWhController extends BaseController
{
@Autowired
private ISjFybpWhService sjFybpWhService;
/**
* 查询三基-费用维护列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpWh:list')")
@GetMapping("/list")
public TableDataInfo list(SjFybpWh sjFybpWh)
{
// startPage();
List<SjFybpWh> list = sjFybpWhService.selectSjFybpWhList(sjFybpWh);
return getDataTable(list);
}
/**
* 导出三基-费用维护列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpWh:export')")
@Log(title = "三基-费用维护", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjFybpWh sjFybpWh)
{
List<SjFybpWh> list = sjFybpWhService.selectSjFybpWhList(sjFybpWh);
ExcelUtil<SjFybpWh> util = new ExcelUtil<SjFybpWh>(SjFybpWh.class);
util.exportExcel(response, list, "三基-费用维护数据");
}
/**
* 获取三基-费用维护详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpWh:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjFybpWhService.selectSjFybpWhById(id));
}
/**
* 新增三基-费用维护
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpWh:add')")
@Log(title = "三基-费用维护", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjFybpWh sjFybpWh)
{
return toAjax(sjFybpWhService.insertSjFybpWh(sjFybpWh));
}
/**
* 修改三基-费用维护
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpWh:edit')")
@Log(title = "三基-费用维护", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjFybpWh sjFybpWh)
{
return toAjax(sjFybpWhService.updateSjFybpWh(sjFybpWh));
}
/**
* 删除三基-费用维护
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpWh:remove')")
@Log(title = "三基-费用维护", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjFybpWhService.deleteSjFybpWhByIds(ids));
}
}
package com.qianhe.domain;
import java.math.BigDecimal;
import java.util.List;
import com.qianhe.domain.SjFybpWh;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
/**
* 三基-费用报批对象 sj_fybp
*
* @author qianhe
* @date 2024-07-05
*/
@Data
public class SjFybp extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 费用名称 */
@Excel(name = "费用名称")
private String fymc;
/** 费用日期 */
@Excel(name = "费用日期")
private String fyrq;
/** 单位 */
@Excel(name = "单位")
private String deptId;
/** 费用类型 */
@Excel(name = "费用类型")
private String fylx;
/** 费用描述 */
@Excel(name = "费用描述")
private String fyms;
/** 费用金额 */
@Excel(name = "费用金额")
private BigDecimal fyje;
/** 文件关联id */
@Excel(name = "文件关联id")
private String fjid;
/** 状态(未提交、待审批、已审批、已驳回) */
@Excel(name = "状态(未提交、待审批、已审批、已驳回)")
private String zt;
/** 提交人 */
@Excel(name = "提交人")
private String tjr;
/** 审批日期 */
@Excel(name = "审批日期")
private String sprq;
/** 审批人 */
@Excel(name = "审批人")
private String spr;
/** 批复金额 */
@Excel(name = "批复金额")
private BigDecimal pfje;
/** 已使用金额 */
@Excel(name = "已使用金额")
private BigDecimal ysyje;
/** 审批意见 */
@Excel(name = "审批意见")
private String spyj;
/** 预留1 */
@Excel(name = "预留1")
private String yl1;
/** 预留2 */
@Excel(name = "预留2")
private String yl2;
/** 预留3 */
@Excel(name = "预留3")
private String yl3;
/** 预留4 */
@Excel(name = "预留4")
private String yl4;
/** 预留5 */
@Excel(name = "预留5")
private String yl5;
//费用审批查询 (传1 查不等于未提交的数据,2查等于已批复的数据)
private String spcx;
/** 三基-费用维护信息 */
private List<SjFybpWh> sjFybpWhList;
private List<WdWdxx> fileList;
}
package com.qianhe.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
/**
* 三基-费用维护对象 sj_fybp_wh
*
* @author qianhe
* @date 2024-07-05
*/
public class SjFybpWh extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 费用报批id */
@Excel(name = "费用报批id")
private Long fybpId;
/** 使用日期 */
@Excel(name = "使用日期")
private String syrq;
/** 费用金额 */
@Excel(name = "费用金额")
private BigDecimal syje;
/** 预留1 */
@Excel(name = "预留1")
private String yl1;
/** 预留2 */
@Excel(name = "预留2")
private String yl2;
/** 预留3 */
@Excel(name = "预留3")
private String yl3;
/** 预留4 */
@Excel(name = "预留4")
private String yl4;
/** 预留5 */
@Excel(name = "预留5")
private String yl5;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFybpId(Long fybpId)
{
this.fybpId = fybpId;
}
public Long getFybpId()
{
return fybpId;
}
public void setSyrq(String syrq)
{
this.syrq = syrq;
}
public String getSyrq()
{
return syrq;
}
public void setSyje(BigDecimal syje)
{
this.syje = syje;
}
public BigDecimal getSyje()
{
return syje;
}
public void setYl1(String yl1)
{
this.yl1 = yl1;
}
public String getYl1()
{
return yl1;
}
public void setYl2(String yl2)
{
this.yl2 = yl2;
}
public String getYl2()
{
return yl2;
}
public void setYl3(String yl3)
{
this.yl3 = yl3;
}
public String getYl3()
{
return yl3;
}
public void setYl4(String yl4)
{
this.yl4 = yl4;
}
public String getYl4()
{
return yl4;
}
public void setYl5(String yl5)
{
this.yl5 = yl5;
}
public String getYl5()
{
return yl5;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fybpId", getFybpId())
.append("syrq", getSyrq())
.append("syje", getSyje())
.append("remark", getRemark())
.append("yl1", getYl1())
.append("yl2", getYl2())
.append("yl3", getYl3())
.append("yl4", getYl4())
.append("yl5", getYl5())
.toString();
}
}
package com.qianhe.mapper;
import java.util.List;
import com.qianhe.domain.SjFybp;
import com.qianhe.domain.SjFybpWh;
/**
* 三基-费用报批Mapper接口
*
* @author qianhe
* @date 2024-07-05
*/
public interface SjFybpMapper
{
/**
* 查询三基-费用报批
*
* @param id 三基-费用报批主键
* @return 三基-费用报批
*/
public SjFybp selectSjFybpById(Long id);
/**
* 查询三基-费用报批列表
*
* @param sjFybp 三基-费用报批
* @return 三基-费用报批集合
*/
public List<SjFybp> selectSjFybpList(SjFybp sjFybp);
/**
* 新增三基-费用报批
*
* @param sjFybp 三基-费用报批
* @return 结果
*/
public int insertSjFybp(SjFybp sjFybp);
/**
* 修改三基-费用报批
*
* @param sjFybp 三基-费用报批
* @return 结果
*/
public int updateSjFybp(SjFybp sjFybp);
/**
* 删除三基-费用报批
*
* @param id 三基-费用报批主键
* @return 结果
*/
public int deleteSjFybpById(Long id);
/**
* 批量删除三基-费用报批
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFybpByIds(Long[] ids);
/**
* 批量删除三基-费用维护
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFybpWhByFybpIds(Long[] ids);
/**
* 批量新增三基-费用维护
*
* @param sjFybpWhList 三基-费用维护列表
* @return 结果
*/
public int batchSjFybpWh(List<SjFybpWh> sjFybpWhList);
/**
* 通过三基-费用报批主键删除三基-费用维护信息
*
* @param id 三基-费用报批ID
* @return 结果
*/
public int deleteSjFybpWhByFybpId(Long id);
}
package com.qianhe.mapper;
import java.util.List;
import com.qianhe.domain.SjFybpWh;
/**
* 三基-费用维护Mapper接口
*
* @author qianhe
* @date 2024-07-05
*/
public interface SjFybpWhMapper
{
/**
* 查询三基-费用维护
*
* @param id 三基-费用维护主键
* @return 三基-费用维护
*/
public SjFybpWh selectSjFybpWhById(Long id);
/**
* 查询三基-费用维护列表
*
* @param sjFybpWh 三基-费用维护
* @return 三基-费用维护集合
*/
public List<SjFybpWh> selectSjFybpWhList(SjFybpWh sjFybpWh);
/**
* 新增三基-费用维护
*
* @param sjFybpWh 三基-费用维护
* @return 结果
*/
public int insertSjFybpWh(SjFybpWh sjFybpWh);
/**
* 修改三基-费用维护
*
* @param sjFybpWh 三基-费用维护
* @return 结果
*/
public int updateSjFybpWh(SjFybpWh sjFybpWh);
/**
* 删除三基-费用维护
*
* @param id 三基-费用维护主键
* @return 结果
*/
public int deleteSjFybpWhById(Long id);
/**
* 批量删除三基-费用维护
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFybpWhByIds(Long[] ids);
}
package com.qianhe.service;
import java.util.List;
import com.qianhe.domain.SjFybp;
/**
* 三基-费用报批Service接口
*
* @author qianhe
* @date 2024-07-05
*/
public interface ISjFybpService
{
/**
* 查询三基-费用报批
*
* @param id 三基-费用报批主键
* @return 三基-费用报批
*/
public SjFybp selectSjFybpById(Long id);
/**
* 查询三基-费用报批列表
*
* @param sjFybp 三基-费用报批
* @return 三基-费用报批集合
*/
public List<SjFybp> selectSjFybpList(SjFybp sjFybp);
/**
* 新增三基-费用报批
*
* @param sjFybp 三基-费用报批
* @return 结果
*/
public int insertSjFybp(SjFybp sjFybp);
/**
* 修改三基-费用报批
*
* @param sjFybp 三基-费用报批
* @return 结果
*/
public int updateSjFybp(SjFybp sjFybp);
/**
* 批量删除三基-费用报批
*
* @param ids 需要删除的三基-费用报批主键集合
* @return 结果
*/
public int deleteSjFybpByIds(Long[] ids);
/**
* 删除三基-费用报批信息
*
* @param id 三基-费用报批主键
* @return 结果
*/
public int deleteSjFybpById(Long id);
int tj(SjFybp sjFybp);
int fywh(SjFybp sjFybp);
}
package com.qianhe.service;
import java.util.List;
import com.qianhe.domain.SjFybpWh;
/**
* 三基-费用维护Service接口
*
* @author qianhe
* @date 2024-07-05
*/
public interface ISjFybpWhService
{
/**
* 查询三基-费用维护
*
* @param id 三基-费用维护主键
* @return 三基-费用维护
*/
public SjFybpWh selectSjFybpWhById(Long id);
/**
* 查询三基-费用维护列表
*
* @param sjFybpWh 三基-费用维护
* @return 三基-费用维护集合
*/
public List<SjFybpWh> selectSjFybpWhList(SjFybpWh sjFybpWh);
/**
* 新增三基-费用维护
*
* @param sjFybpWh 三基-费用维护
* @return 结果
*/
public int insertSjFybpWh(SjFybpWh sjFybpWh);
/**
* 修改三基-费用维护
*
* @param sjFybpWh 三基-费用维护
* @return 结果
*/
public int updateSjFybpWh(SjFybpWh sjFybpWh);
/**
* 批量删除三基-费用维护
*
* @param ids 需要删除的三基-费用维护主键集合
* @return 结果
*/
public int deleteSjFybpWhByIds(Long[] ids);
/**
* 删除三基-费用维护信息
*
* @param id 三基-费用维护主键
* @return 结果
*/
public int deleteSjFybpWhById(Long id);
}
package com.qianhe.service.impl;
import java.util.List;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.domain.WdLxwh;
import com.qianhe.mapper.SjFybpWhMapper;
import com.qianhe.mapper.WdWdxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.qianhe.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.qianhe.domain.SjFybpWh;
import com.qianhe.mapper.SjFybpMapper;
import com.qianhe.domain.SjFybp;
import com.qianhe.service.ISjFybpService;
/**
* 三基-费用报批Service业务层处理
*
* @author qianhe
* @date 2024-07-05
*/
@Service
public class SjFybpServiceImpl implements ISjFybpService
{
@Autowired
private SjFybpMapper sjFybpMapper;
@Autowired
private SjFybpWhMapper sjFybpWhMapper;
@Autowired
private WdWdxxMapper wdWdxxMapper;
/**
* 查询三基-费用报批
*
* @param id 三基-费用报批主键
* @return 三基-费用报批
*/
@Override
public SjFybp selectSjFybpById(Long id)
{
SjFybp sjFybp = sjFybpMapper.selectSjFybpById(id);
//查询费用维护
SjFybpWh sjFybpWh=new SjFybpWh();
List<SjFybpWh> sjFybpWhs = sjFybpWhMapper.selectSjFybpWhList(sjFybpWh);
sjFybp.setSjFybpWhList(sjFybpWhs);
return sjFybp;
}
/**
* 查询三基-费用报批列表
*
* @param sjFybp 三基-费用报批
* @return 三基-费用报批
*/
@Override
@DataScope(deptAlias = "d")
public List<SjFybp> selectSjFybpList(SjFybp sjFybp)
{
return sjFybpMapper.selectSjFybpList(sjFybp);
}
/**
* 新增三基-费用报批
*
* @param sjFybp 三基-费用报批
* @return 结果
*/
@Transactional
@Override
public int insertSjFybp(SjFybp sjFybp)
{
sjFybp.setCreateTime(DateUtils.getNowDate());
sjFybp.setCreateBy(SecurityUtils.getUsername());
int rows = sjFybpMapper.insertSjFybp(sjFybp);
//保存文件
if(sjFybp.getFileList().size()>0){
sjFybp.getFileList().forEach(file->{
file.setGlId(sjFybp.getId().toString());
file.setMkmc("费用报批");
file.setFjlx("费用上报");
file.setLrr(SecurityUtils.getUsername());
wdWdxxMapper.insertWdWdxx(file);
});
}
return rows;
}
/**
* 修改三基-费用报批
*
* @param sjFybp 三基-费用报批
* @return 结果
*/
@Transactional
@Override
public int updateSjFybp(SjFybp sjFybp)
{
//先删除文件
wdWdxxMapper.deleteWdWdxxByGlIdAndMkmc(sjFybp.getId()+"","费用报批");
//保存文件
if(sjFybp.getFileList().size()>0){
sjFybp.getFileList().forEach(file->{
file.setGlId(sjFybp.getId().toString());
file.setMkmc("费用报批");
file.setFjlx("费用上报");
file.setLrr(SecurityUtils.getUsername());
wdWdxxMapper.insertWdWdxx(file);
});
}
sjFybp.setUpdateTime(DateUtils.getNowDate());
sjFybp.setUpdateBy(SecurityUtils.getUsername());
return sjFybpMapper.updateSjFybp(sjFybp);
}
/**
* 批量删除三基-费用报批
*
* @param ids 需要删除的三基-费用报批主键
* @return 结果
*/
@Transactional
@Override
public int deleteSjFybpByIds(Long[] ids)
{
sjFybpMapper.deleteSjFybpWhByFybpIds(ids);
return sjFybpMapper.deleteSjFybpByIds(ids);
}
/**
* 删除三基-费用报批信息
*
* @param id 三基-费用报批主键
* @return 结果
*/
@Transactional
@Override
public int deleteSjFybpById(Long id)
{
sjFybpMapper.deleteSjFybpWhByFybpId(id);
return sjFybpMapper.deleteSjFybpById(id);
}
@Override
public int tj(SjFybp sjFybp) {
return sjFybpMapper.updateSjFybp(sjFybp);
}
@Override
public int fywh(SjFybp sjFybp) {
sjFybpMapper.deleteSjFybpWhByFybpId(sjFybp.getId());
insertSjFybpWh(sjFybp);
return 1;
}
/**
* 新增三基-费用维护信息
*
* @param sjFybp 三基-费用报批对象
*/
public void insertSjFybpWh(SjFybp sjFybp)
{
List<SjFybpWh> sjFybpWhList = sjFybp.getSjFybpWhList();
Long id = sjFybp.getId();
if (StringUtils.isNotNull(sjFybpWhList))
{
List<SjFybpWh> list = new ArrayList<SjFybpWh>();
for (SjFybpWh sjFybpWh : sjFybpWhList)
{
sjFybpWh.setFybpId(id);
list.add(sjFybpWh);
}
if (list.size() > 0)
{
sjFybpMapper.batchSjFybpWh(list);
}
}
}
}
package com.qianhe.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qianhe.mapper.SjFybpWhMapper;
import com.qianhe.domain.SjFybpWh;
import com.qianhe.service.ISjFybpWhService;
/**
* 三基-费用维护Service业务层处理
*
* @author qianhe
* @date 2024-07-05
*/
@Service
public class SjFybpWhServiceImpl implements ISjFybpWhService
{
@Autowired
private SjFybpWhMapper sjFybpWhMapper;
/**
* 查询三基-费用维护
*
* @param id 三基-费用维护主键
* @return 三基-费用维护
*/
@Override
public SjFybpWh selectSjFybpWhById(Long id)
{
return sjFybpWhMapper.selectSjFybpWhById(id);
}
/**
* 查询三基-费用维护列表
*
* @param sjFybpWh 三基-费用维护
* @return 三基-费用维护
*/
@Override
public List<SjFybpWh> selectSjFybpWhList(SjFybpWh sjFybpWh)
{
return sjFybpWhMapper.selectSjFybpWhList(sjFybpWh);
}
/**
* 新增三基-费用维护
*
* @param sjFybpWh 三基-费用维护
* @return 结果
*/
@Override
public int insertSjFybpWh(SjFybpWh sjFybpWh)
{
return sjFybpWhMapper.insertSjFybpWh(sjFybpWh);
}
/**
* 修改三基-费用维护
*
* @param sjFybpWh 三基-费用维护
* @return 结果
*/
@Override
public int updateSjFybpWh(SjFybpWh sjFybpWh)
{
return sjFybpWhMapper.updateSjFybpWh(sjFybpWh);
}
/**
* 批量删除三基-费用维护
*
* @param ids 需要删除的三基-费用维护主键
* @return 结果
*/
@Override
public int deleteSjFybpWhByIds(Long[] ids)
{
return sjFybpWhMapper.deleteSjFybpWhByIds(ids);
}
/**
* 删除三基-费用维护信息
*
* @param id 三基-费用维护主键
* @return 结果
*/
@Override
public int deleteSjFybpWhById(Long id)
{
return sjFybpWhMapper.deleteSjFybpWhById(id);
}
}
<?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.qianhe.mapper.SjFybpMapper">
<resultMap type="SjFybp" id="SjFybpResult">
<result property="id" column="id" />
<result property="fymc" column="fymc" />
<result property="fyrq" column="fyrq" />
<result property="deptId" column="dept_id" />
<result property="fylx" column="fylx" />
<result property="fyms" column="fyms" />
<result property="fyje" column="fyje" />
<result property="fjid" column="fjid" />
<result property="zt" column="zt" />
<result property="tjr" column="tjr" />
<result property="sprq" column="sprq" />
<result property="spr" column="spr" />
<result property="pfje" column="pfje" />
<result property="ysyje" column="ysyje" />
<result property="spyj" column="spyj" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
</resultMap>
<resultMap id="SjFybpSjFybpWhResult" type="SjFybp" extends="SjFybpResult">
<collection property="sjFybpWhList" notNullColumn="sub_id" javaType="java.util.List" resultMap="SjFybpWhResult" />
</resultMap>
<resultMap type="SjFybpWh" id="SjFybpWhResult">
<result property="id" column="sub_id" />
<result property="fybpId" column="sub_fybp_id" />
<result property="syrq" column="sub_syrq" />
<result property="syje" column="sub_syje" />
<result property="remark" column="sub_remark" />
<result property="yl1" column="sub_yl1" />
<result property="yl2" column="sub_yl2" />
<result property="yl3" column="sub_yl3" />
<result property="yl4" column="sub_yl4" />
<result property="yl5" column="sub_yl5" />
</resultMap>
<sql id="selectSjFybpVo">
select id,
fymc,
fyrq,
a.dept_id,
fylx,
fyms,
fyje,
fjid,
zt,
tjr,
sprq,
spr,
pfje,
ysyje,
spyj,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
remark,
yl1,
yl2,
yl3,
yl4,
yl5
from sj_fybp a
left join sys_dept d on a.dept_id=d.dept_id </sql>
<select id="selectSjFybpList" parameterType="SjFybp" resultMap="SjFybpResult">
<include refid="selectSjFybpVo"/>
<where>
<if test="fymc != null and fymc != ''"> and fymc = #{fymc}</if>
<if test="fyrq != null and fyrq != ''"> and fyrq = #{fyrq}</if>
<if test="deptId != null and deptId != ''"> and (dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="fylx != null and fylx != ''"> and fylx = #{fylx}</if>
<if test="fyms != null and fyms != ''"> and fyms = #{fyms}</if>
<if test="fyje != null "> and fyje = #{fyje}</if>
<if test="fjid != null and fjid != ''"> and fjid = #{fjid}</if>
<if test="zt != null and zt != ''"> and zt = #{zt}</if>
<if test="tjr != null and tjr != ''"> and tjr = #{tjr}</if>
<if test="sprq != null and sprq != ''"> and sprq = #{sprq}</if>
<if test="spr != null and spr != ''"> and spr = #{spr}</if>
<if test="pfje != null "> and pfje = #{pfje}</if>
<if test="ysyje != null "> and ysyje = #{ysyje}</if>
<if test="spyj != null and spyj != ''"> and spyj = #{spyj}</if>
<if test="yl1 != null and yl1 != ''"> and yl1 = #{yl1}</if>
<if test="yl2 != null and yl2 != ''"> and yl2 = #{yl2}</if>
<if test="yl3 != null and yl3 != ''"> and yl3 = #{yl3}</if>
<if test="yl4 != null and yl4 != ''"> and yl4 = #{yl4}</if>
<if test="yl5 != null and yl5 != ''"> and yl5 = #{yl5}</if>
<if test="spcx != null and spcx != '' and spcx=='1'.toString()"> and zt !='未提交'</if>
<if test="spcx != null and spcx != '' and spcx=='2'.toString()"> and zt ='已批复'</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectSjFybpById" parameterType="Long" resultMap="SjFybpResult">
select a.id, a.fymc, a.fyrq, a.dept_id, a.fylx, a.fyms, a.fyje, a.fjid, a.zt, a.tjr, a.sprq, a.spr, a.pfje, a.ysyje, a.spyj, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.yl1, a.yl2, a.yl3, a.yl4, a.yl5
from sj_fybp a
where a.id = #{id}
</select>
<insert id="insertSjFybp" parameterType="SjFybp" useGeneratedKeys="true" keyProperty="id">
insert into sj_fybp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fymc != null">fymc,</if>
<if test="fyrq != null">fyrq,</if>
<if test="deptId != null">dept_id,</if>
<if test="fylx != null">fylx,</if>
<if test="fyms != null">fyms,</if>
<if test="fyje != null">fyje,</if>
<if test="fjid != null">fjid,</if>
<if test="zt != null">zt,</if>
<if test="tjr != null">tjr,</if>
<if test="sprq != null">sprq,</if>
<if test="spr != null">spr,</if>
<if test="pfje != null">pfje,</if>
<if test="ysyje != null">ysyje,</if>
<if test="spyj != null">spyj,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="yl1 != null">yl1,</if>
<if test="yl2 != null">yl2,</if>
<if test="yl3 != null">yl3,</if>
<if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fymc != null">#{fymc},</if>
<if test="fyrq != null">#{fyrq},</if>
<if test="deptId != null">#{deptId},</if>
<if test="fylx != null">#{fylx},</if>
<if test="fyms != null">#{fyms},</if>
<if test="fyje != null">#{fyje},</if>
<if test="fjid != null">#{fjid},</if>
<if test="zt != null">#{zt},</if>
<if test="tjr != null">#{tjr},</if>
<if test="sprq != null">#{sprq},</if>
<if test="spr != null">#{spr},</if>
<if test="pfje != null">#{pfje},</if>
<if test="ysyje != null">#{ysyje},</if>
<if test="spyj != null">#{spyj},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="yl1 != null">#{yl1},</if>
<if test="yl2 != null">#{yl2},</if>
<if test="yl3 != null">#{yl3},</if>
<if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if>
</trim>
</insert>
<update id="updateSjFybp" parameterType="SjFybp">
update sj_fybp
<trim prefix="SET" suffixOverrides=",">
<if test="fymc != null">fymc = #{fymc},</if>
<if test="fyrq != null">fyrq = #{fyrq},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="fylx != null">fylx = #{fylx},</if>
<if test="fyms != null">fyms = #{fyms},</if>
<if test="fyje != null">fyje = #{fyje},</if>
<if test="fjid != null">fjid = #{fjid},</if>
<if test="zt != null">zt = #{zt},</if>
<if test="tjr != null">tjr = #{tjr},</if>
<if test="sprq != null">sprq = #{sprq},</if>
<if test="spr != null">spr = #{spr},</if>
<if test="pfje != null">pfje = #{pfje},</if>
<if test="ysyje != null">ysyje = #{ysyje},</if>
<if test="spyj != null">spyj = #{spyj},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="yl1 != null">yl1 = #{yl1},</if>
<if test="yl2 != null">yl2 = #{yl2},</if>
<if test="yl3 != null">yl3 = #{yl3},</if>
<if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjFybpById" parameterType="Long">
delete from sj_fybp where id = #{id}
</delete>
<delete id="deleteSjFybpByIds" parameterType="String">
delete from sj_fybp where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSjFybpWhByFybpIds" parameterType="String">
delete from sj_fybp_wh where fybp_id in
<foreach item="fybpId" collection="array" open="(" separator="," close=")">
#{fybpId}
</foreach>
</delete>
<delete id="deleteSjFybpWhByFybpId" parameterType="Long">
delete from sj_fybp_wh where fybp_id = #{fybpId}
</delete>
<insert id="batchSjFybpWh">
insert into sj_fybp_wh( id, fybp_id, syrq, syje, remark, yl1, yl2, yl3, yl4, yl5) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.fybpId}, #{item.syrq}, #{item.syje}, #{item.remark}, #{item.yl1}, #{item.yl2}, #{item.yl3}, #{item.yl4}, #{item.yl5})
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?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.qianhe.mapper.SjFybpWhMapper">
<resultMap type="SjFybpWh" id="SjFybpWhResult">
<result property="id" column="id" />
<result property="fybpId" column="fybp_id" />
<result property="syrq" column="syrq" />
<result property="syje" column="syje" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
</resultMap>
<sql id="selectSjFybpWhVo">
select id, fybp_id, syrq, syje, remark, yl1, yl2, yl3, yl4, yl5 from sj_fybp_wh
</sql>
<select id="selectSjFybpWhList" parameterType="SjFybpWh" resultMap="SjFybpWhResult">
<include refid="selectSjFybpWhVo"/>
<where>
<if test="fybpId != null "> and fybp_id = #{fybpId}</if>
<if test="syrq != null and syrq != ''"> and syrq = #{syrq}</if>
<if test="syje != null "> and syje = #{syje}</if>
<if test="yl1 != null and yl1 != ''"> and yl1 = #{yl1}</if>
<if test="yl2 != null and yl2 != ''"> and yl2 = #{yl2}</if>
<if test="yl3 != null and yl3 != ''"> and yl3 = #{yl3}</if>
<if test="yl4 != null and yl4 != ''"> and yl4 = #{yl4}</if>
<if test="yl5 != null and yl5 != ''"> and yl5 = #{yl5}</if>
</where>
</select>
<select id="selectSjFybpWhById" parameterType="Long" resultMap="SjFybpWhResult">
<include refid="selectSjFybpWhVo"/>
where id = #{id}
</select>
<insert id="insertSjFybpWh" parameterType="SjFybpWh" useGeneratedKeys="true" keyProperty="id">
insert into sj_fybp_wh
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fybpId != null">fybp_id,</if>
<if test="syrq != null">syrq,</if>
<if test="syje != null">syje,</if>
<if test="remark != null">remark,</if>
<if test="yl1 != null">yl1,</if>
<if test="yl2 != null">yl2,</if>
<if test="yl3 != null">yl3,</if>
<if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fybpId != null">#{fybpId},</if>
<if test="syrq != null">#{syrq},</if>
<if test="syje != null">#{syje},</if>
<if test="remark != null">#{remark},</if>
<if test="yl1 != null">#{yl1},</if>
<if test="yl2 != null">#{yl2},</if>
<if test="yl3 != null">#{yl3},</if>
<if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if>
</trim>
</insert>
<update id="updateSjFybpWh" parameterType="SjFybpWh">
update sj_fybp_wh
<trim prefix="SET" suffixOverrides=",">
<if test="fybpId != null">fybp_id = #{fybpId},</if>
<if test="syrq != null">syrq = #{syrq},</if>
<if test="syje != null">syje = #{syje},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="yl1 != null">yl1 = #{yl1},</if>
<if test="yl2 != null">yl2 = #{yl2},</if>
<if test="yl3 != null">yl3 = #{yl3},</if>
<if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjFybpWhById" parameterType="Long">
delete from sj_fybp_wh where id = #{id}
</delete>
<delete id="deleteSjFybpWhByIds" parameterType="String">
delete from sj_fybp_wh where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
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