parent
47a6aacc65
commit
0251f076d6
@ -0,0 +1,87 @@
|
|||||||
|
package com.ruoyi.programManagement.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.programManagement.entity.BStandardization;
|
||||||
|
import com.ruoyi.programManagement.service.IBStandardizationService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准化Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @since 2023-12-18
|
||||||
|
*/
|
||||||
|
@Api(tags = "标准化")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/programManagement/standardization")
|
||||||
|
public class BStandardizationController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private IBStandardizationService bStandardizationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标准化列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询标准化列表", response = BStandardization.class)
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(BStandardization bStandardization) {
|
||||||
|
startPage();
|
||||||
|
List<BStandardization> list = bStandardizationService.selectBStandardizationList(bStandardization);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出标准化列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "导出标准化列表")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, BStandardization bStandardization) {
|
||||||
|
List<BStandardization> list = bStandardizationService.selectBStandardizationList(bStandardization);
|
||||||
|
ExcelUtil<BStandardization> util = new ExcelUtil<BStandardization>(BStandardization.class);
|
||||||
|
util.exportExcel(response, list, "标准化数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取标准化详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = " 获取标准化详细信息")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return success(bStandardizationService.selectBStandardizationById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增标准化
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = " 新增标准化")
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody BStandardization bStandardization) {
|
||||||
|
return toAjax(bStandardizationService.insertBStandardization(bStandardization));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改标准化
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = " 修改标准化")
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody BStandardization bStandardization) {
|
||||||
|
return toAjax(bStandardizationService.updateBStandardization(bStandardization));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标准化
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = " 删除标准化")
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(bStandardizationService.deleteBStandardizationByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.ruoyi.programManagement.entity;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准化对象 b_standardization
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @since 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("标准化")
|
||||||
|
public class BStandardization extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "企业名称")
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String enterpriseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准化等级
|
||||||
|
*/
|
||||||
|
@Excel(name = "标准化等级")
|
||||||
|
@ApiModelProperty(value = "标准化等级")
|
||||||
|
private String standardizedGrade;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.ruoyi.programManagement.entity.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@ApiModel
|
||||||
|
@Data
|
||||||
|
@Builder(toBuilder = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BPlanEnterPrisetDistrictRequest {
|
||||||
|
/**
|
||||||
|
* 区划代码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("区划代码")
|
||||||
|
private String districtCode;
|
||||||
|
/**
|
||||||
|
* 区划
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("区划")
|
||||||
|
private String district;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划企业数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("计划企业数量")
|
||||||
|
private Integer enterPriseCounty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划企业完成数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("计划企业完成数量")
|
||||||
|
private Integer enterPriseFinsh;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成率
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("完成率")
|
||||||
|
private String result;
|
||||||
|
|
||||||
|
|
||||||
|
private List<BPlanEnterPriseTreeRequest> children;
|
||||||
|
|
||||||
|
public BPlanEnterPrisetDistrictRequest(String districtCode, String district, Integer enterPriseCounty, Integer enterPriseFinsh,String result) {
|
||||||
|
this.districtCode = districtCode;
|
||||||
|
this.enterPriseCounty = enterPriseCounty;
|
||||||
|
this.enterPriseFinsh = enterPriseFinsh;
|
||||||
|
this.district = district;
|
||||||
|
this.result=result;
|
||||||
|
this.children = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addChild(BPlanEnterPriseTreeRequest childDto) {
|
||||||
|
this.children.add(childDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.programManagement.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.programManagement.entity.BStandardization;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准化Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @since 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface BStandardizationMapper {
|
||||||
|
/**
|
||||||
|
* 查询标准化
|
||||||
|
*
|
||||||
|
* @param id 标准化主键
|
||||||
|
* @return 标准化
|
||||||
|
*/
|
||||||
|
public BStandardization selectBStandardizationById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标准化列表
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 标准化集合
|
||||||
|
*/
|
||||||
|
List<BStandardization> selectBStandardizationList(BStandardization bStandardization);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增标准化
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertBStandardization(BStandardization bStandardization);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改标准化
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateBStandardization(BStandardization bStandardization);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标准化
|
||||||
|
*
|
||||||
|
* @param id 标准化主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteBStandardizationById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除标准化
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteBStandardizationByIds(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,143 @@
|
|||||||
|
package com.ruoyi.programManagement.quartz;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.programManagement.entity.*;
|
||||||
|
import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper;
|
||||||
|
import com.ruoyi.programManagement.mapper.BStandardizationMapper;
|
||||||
|
import com.ruoyi.programManagement.mapper.SzsEnterpriseInformationMapper;
|
||||||
|
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
|
||||||
|
import com.ruoyi.programManagement.service.ISzEnforExamineService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务更新企业新表
|
||||||
|
*/
|
||||||
|
//@Configuration
|
||||||
|
//@EnableScheduling
|
||||||
|
@Api(tags = "定时任务")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pharmaceuticals/quartz")
|
||||||
|
public class EnterpristQuartz {
|
||||||
|
@Autowired
|
||||||
|
private SzsEnterpriseInformationMapper szsEnterpriseInformationMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BEnterpriseNewMapper bEnterpriseNewMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BStandardizationMapper bStandardizationMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISzEnforExamineService szEnforExamineService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BPlanEnterpriseService bPlanEnterpriseService;
|
||||||
|
|
||||||
|
// 每周一早上五点5点执行一次任务 生成企业新表
|
||||||
|
// @Scheduled(cron = "0 0 17 ? * SUN")
|
||||||
|
@GetMapping("/getList")
|
||||||
|
@ApiOperation(value = "定时任务")
|
||||||
|
public AjaxResult updateInformationData() {
|
||||||
|
// 查询szs_enterprise_informa tion表中的数据
|
||||||
|
List<SzsEnterpriseInformation> enterpriseInformationList = szsEnterpriseInformationMapper.selectSzsEnterpriseInformationList(null);
|
||||||
|
// 遍历数据并更新到b_enterprise_new表中
|
||||||
|
List<String> szsList = new ArrayList<>();
|
||||||
|
for (SzsEnterpriseInformation enterpriseInformation : enterpriseInformationList) {
|
||||||
|
BEnterpriseNew enterpriseNew = new BEnterpriseNew();
|
||||||
|
enterpriseNew.setEnterpriseId(enterpriseInformation.getUuitNo());
|
||||||
|
enterpriseNew.setEnterpriseName(enterpriseInformation.getEnterpriseName());
|
||||||
|
enterpriseNew.setDistrict(enterpriseInformation.getSubdistrict());
|
||||||
|
enterpriseNew.setSupervisionLarge(enterpriseInformation.getSupervisionLarge());
|
||||||
|
// 根据enterpriseId判断数据是否已存在
|
||||||
|
QueryWrapper<BEnterpriseNew> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("enterprise_id", enterpriseInformation.getUuitNo());
|
||||||
|
//获取enterpriseName
|
||||||
|
szsList.add(enterpriseNew.getEnterpriseName());
|
||||||
|
Long count = bEnterpriseNewMapper.selectCount(queryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
// 更新数据
|
||||||
|
bEnterpriseNewMapper.updateBEnterpriseNew(enterpriseNew);
|
||||||
|
} else {
|
||||||
|
// 插入数据
|
||||||
|
bEnterpriseNewMapper.insertBEnterpriseNew(enterpriseNew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 查询b_enterprise_new表中的所有企业名称
|
||||||
|
List<BEnterpriseNew> enterpriseList = bEnterpriseNewMapper.selectBEnterpriseNewList(null);
|
||||||
|
// 查询b_standardization表中的所有企业名称
|
||||||
|
List<BStandardization> standardizationList = bStandardizationMapper.selectBStandardizationList(null);
|
||||||
|
//更新b_enterprise_new表中匹配的企业的STAND_LEVEL字段
|
||||||
|
for (BEnterpriseNew enterprise : enterpriseList) {
|
||||||
|
for (BStandardization standardization : standardizationList) {
|
||||||
|
if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
|
||||||
|
// 执行更新操作,例如:
|
||||||
|
enterprise.setStandLevel(standardization.getStandardizedGrade());
|
||||||
|
bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
|
||||||
|
} else {
|
||||||
|
enterprise.setStandLevel("/");
|
||||||
|
bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 找出在b_standardization表中存在但在b_enterprise_new表中不存在的企业名称
|
||||||
|
List<BStandardization> notInEnterpriseNew = new ArrayList<>();
|
||||||
|
for (BStandardization standardization : standardizationList) {
|
||||||
|
boolean found = false;
|
||||||
|
for (BEnterpriseNew enterprise : enterpriseList) {
|
||||||
|
if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
BStandardization b = new BStandardization();
|
||||||
|
b.setStandardizedGrade(standardization.getStandardizedGrade());
|
||||||
|
b.setEnterpriseName(standardization.getEnterpriseName());
|
||||||
|
notInEnterpriseNew.add(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 查询b_enterprise_new表中的所有企业名称 更新检查时间
|
||||||
|
for (BEnterpriseNew a : enterpriseList) {
|
||||||
|
BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
|
||||||
|
List<SzEnforExamine> szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId());
|
||||||
|
for (SzEnforExamine b:szEnforExamineList) {
|
||||||
|
bEnterpriseNew.setId(a.getId());
|
||||||
|
bEnterpriseNew.setExamineEndTime(b.getExamineEndTime());
|
||||||
|
bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(notInEnterpriseNew);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 定时任务修改更新计划表的检查状态、检查id、检查时效字段
|
||||||
|
@GetMapping("/updateExamine")
|
||||||
|
@ApiOperation(value = "定时任务修改更新计划表的检查状态、检查id、检查时效字段")
|
||||||
|
public AjaxResult updateExamine() {
|
||||||
|
//查询计划表中的所有数据
|
||||||
|
List<BPlanEnterprise> list = bPlanEnterpriseService.selectBPlanEnterpriseList(null);
|
||||||
|
for (BPlanEnterprise a:list){
|
||||||
|
BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
|
||||||
|
List<SzEnforExamine> szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId());
|
||||||
|
for (SzEnforExamine b:szEnforExamineList) {
|
||||||
|
bEnterpriseNew.setId(a.getId());
|
||||||
|
bEnterpriseNew.setExamineEndTime(b.getExamineEndTime());
|
||||||
|
bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.programManagement.service;
|
||||||
|
|
||||||
|
import com.ruoyi.programManagement.entity.BStandardization;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准化Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @since 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IBStandardizationService {
|
||||||
|
/**
|
||||||
|
* 查询标准化
|
||||||
|
*
|
||||||
|
* @param id 标准化主键
|
||||||
|
* @return 标准化
|
||||||
|
*/
|
||||||
|
public BStandardization selectBStandardizationById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标准化列表
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 标准化集合
|
||||||
|
*/
|
||||||
|
List<BStandardization> selectBStandardizationList(BStandardization bStandardization);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增标准化
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertBStandardization(BStandardization bStandardization);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改标准化
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateBStandardization(BStandardization bStandardization);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除标准化
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的标准化主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteBStandardizationByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标准化信息
|
||||||
|
*
|
||||||
|
* @param id 标准化主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteBStandardizationById(Long id);
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.ruoyi.programManagement.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.programManagement.entity.BStandardization;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.programManagement.mapper.BStandardizationMapper;
|
||||||
|
|
||||||
|
import com.ruoyi.programManagement.service.IBStandardizationService;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准化Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @since 2023-12-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BStandardizationServiceImpl implements IBStandardizationService {
|
||||||
|
@Resource
|
||||||
|
private BStandardizationMapper bStandardizationMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标准化
|
||||||
|
*
|
||||||
|
* @param id 标准化主键
|
||||||
|
* @return 标准化
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BStandardization selectBStandardizationById(Long id) {
|
||||||
|
return bStandardizationMapper.selectBStandardizationById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标准化列表
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 标准化
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BStandardization> selectBStandardizationList(BStandardization bStandardization) {
|
||||||
|
return bStandardizationMapper.selectBStandardizationList(bStandardization);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增标准化
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBStandardization(BStandardization bStandardization) {
|
||||||
|
return bStandardizationMapper.insertBStandardization(bStandardization);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改标准化
|
||||||
|
*
|
||||||
|
* @param bStandardization 标准化
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBStandardization(BStandardization bStandardization) {
|
||||||
|
return bStandardizationMapper.updateBStandardization(bStandardization);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除标准化
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的标准化主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBStandardizationByIds(Long[] ids) {
|
||||||
|
return bStandardizationMapper.deleteBStandardizationByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标准化信息
|
||||||
|
*
|
||||||
|
* @param id 标准化主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBStandardizationById(Long id) {
|
||||||
|
return bStandardizationMapper.deleteBStandardizationById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
<?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.ruoyi.programManagement.mapper.BStandardizationMapper">
|
||||||
|
|
||||||
|
<resultMap type="BStandardization" id="BStandardizationResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="enterpriseName" column="enterprise_name" />
|
||||||
|
<result property="standardizedGrade" column="standardized_grade" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBStandardizationVo">
|
||||||
|
select id, enterprise_name, standardized_grade from b_standardization
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBStandardizationList" parameterType="BStandardization" resultMap="BStandardizationResult">
|
||||||
|
<include refid="selectBStandardizationVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
||||||
|
<if test="standardizedGrade != null and standardizedGrade != ''"> and standardized_grade = #{standardizedGrade}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBStandardizationById" parameterType="Long" resultMap="BStandardizationResult">
|
||||||
|
<include refid="selectBStandardizationVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBStandardization" parameterType="BStandardization" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into b_standardization
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="enterpriseName != null">enterprise_name,</if>
|
||||||
|
<if test="standardizedGrade != null">standardized_grade,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="enterpriseName != null">#{enterpriseName},</if>
|
||||||
|
<if test="standardizedGrade != null">#{standardizedGrade},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBStandardization" parameterType="BStandardization">
|
||||||
|
update b_standardization
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
|
||||||
|
<if test="standardizedGrade != null">standardized_grade = #{standardizedGrade},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBStandardizationById" parameterType="Long">
|
||||||
|
delete from b_standardization where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBStandardizationByIds" parameterType="String">
|
||||||
|
delete from b_standardization where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in new issue