New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.ProjectArchiveManage; |
| | | import com.whyc.pojo.ProjectManage; |
| | | import com.whyc.service.ProjectArchiveManageService; |
| | | import com.whyc.service.ProjectProcessManageService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | |
| | | /** |
| | | * 项目管理/项目归档管理、项目过程管理 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("projectManage") |
| | | @Api(tags = "项目管理") |
| | | public class ProjectManageController { |
| | | |
| | | @Autowired |
| | | private ProjectProcessManageService service; |
| | | |
| | | |
| | | @Autowired |
| | | private ProjectArchiveManageService archiveManageService; |
| | | |
| | | |
| | | @GetMapping("all") |
| | | @ApiOperation(value = "项目过程管理-查询所有") |
| | | public Response<List<ProjectManage>> searchAll() { |
| | | |
| | | return service.searchAll(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("byCondition") |
| | | @ApiOperation(notes = "项目过程管理",value = "项目过程管理-条件查询") |
| | | public Response<List<ProjectManage>> searchByCondition(@ApiParam(value = "申报日期 格式 2021/01/28",required = true) @RequestParam Date proCreatedate, |
| | | @ApiParam(value = "项目类型",required = true)@RequestParam int proSort, |
| | | @ApiParam(value = "项目状态",required = true)@RequestParam int proState, |
| | | @ApiParam(value = "项目编号",required = true)@RequestParam String proNum) { |
| | | ProjectManage projectManage = new ProjectManage(); |
| | | projectManage.setProCreatedate(proCreatedate); |
| | | projectManage.setProSort(proSort); |
| | | projectManage.setProState(proState); |
| | | projectManage.setProNum(proNum); |
| | | return service.searchByCondition(projectManage); |
| | | } |
| | | |
| | | @PostMapping("add") |
| | | @ApiOperation(value = "新建项目",notes = "notes中存文件地址用 ; 分隔 {\n" + |
| | | " \"proNum\": S0900033,\n" + |
| | | " \"proName\": \"\",\n" + |
| | | " \"proNameCode\": \"yyyyMMddHHmmss格式字符串\",\n" + |
| | | " \"proSort\": 0,\n" + |
| | | " \"proAdmin\": \"张三\",\n" + |
| | | " \"proTel\": 13800003131,\n" + |
| | | " \"proCreatedate\": \"2021-03-27 08:18:27\",\n" + |
| | | " \"proExecutionDate\": \"2021-03-27 08:18:27\",\n" + |
| | | " \"proExecutionDate1\": \"2021-03-27 08:18:27\",\n" + |
| | | " \"proPerson\": \"参与人员\",\n" + |
| | | " \"proFunding\": 0,\n" + |
| | | " \"proFundingSource\": \"经费来源\",\n" + |
| | | " \"proContent\": \" \",\n" + |
| | | " \"proState\": 0,\n" + |
| | | " \"note\": \"拼接多个文件地址\"\n" + |
| | | "}") |
| | | public Response add(@RequestBody ProjectManage projectManage) { |
| | | |
| | | Response response = service.add(projectManage); |
| | | return response; |
| | | } |
| | | |
| | | /** |
| | | * 文件存储后地址更新到对应项目编号的地址,一个项目对应多个文件 db_experiment.tb_project_archive_manage |
| | | * 是否需要将word转pdf/预览文件pdf |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @PostMapping("upload") |
| | | @ApiOperation(notes = "返回文件地址,确认时提交保存到字段",value = "文档材料添加(选择文件)") |
| | | public Response upload(@RequestParam("file") MultipartFile file) { |
| | | // 获取原始名字 |
| | | String fileName = file.getOriginalFilename(); |
| | | // 获取后缀名 |
| | | // String suffixName = fileName.substring(fileName.lastIndexOf(".")); |
| | | // 文件保存路径、后期考虑按日期或者月份建dir |
| | | String filePath = "c:/upload/"; |
| | | // 文件重命名,防止重复,预览时需要显示原文件名 _ 切割 |
| | | fileName = filePath + UUID.randomUUID() + "_" + fileName; |
| | | // 文件对象 |
| | | File dest = new File(fileName); |
| | | // 判断路径是否存在,如果不存在则创建 |
| | | if (!dest.getParentFile().exists()) { |
| | | dest.getParentFile().mkdirs(); |
| | | } |
| | | try { |
| | | // 保存到服务器中 |
| | | file.transferTo(dest); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return new Response().setCode(0); |
| | | } |
| | | Response<Object> response = new Response<>(); |
| | | response.setMsg(1, fileName); |
| | | return response; |
| | | } |
| | | |
| | | |
| | | @GetMapping("managesState") |
| | | @ApiOperation(notes = "项目管理-己确认阶段", value = "项目管理-己确认阶段查询") |
| | | public Response<Object> searchManageStateByCondition(@ApiParam(value = "项目编号", required = true) @RequestParam String proNum, |
| | | @ApiParam(value = "项目名称代码", required = true) @RequestParam String proNameCode) { |
| | | ProjectManage projectManage = new ProjectManage(); |
| | | projectManage.setProNum(proNum); |
| | | projectManage.setProNameCode(proNameCode); |
| | | return service.searchManageStateByCondition(projectManage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 项目进度确认 pro_progress |
| | | * @return |
| | | */ |
| | | @PutMapping("updateManageState") |
| | | @ApiOperation(notes = "项目管理-己确认阶段",value = "项目管理-己确认阶段更新") |
| | | public Response updateManageState(@ApiParam(value = "项目编号", required = true) @RequestParam String proNum, |
| | | @ApiParam(value = "项目名称代码", required = true) @RequestParam String proNameCode, |
| | | @ApiParam(value = "项目进度确认0-6",required = true)@RequestParam int proProgress, |
| | | @ApiParam(value = "文档上传保存地址(如果无传空字符串)",required = true)@RequestParam String proFilePath) { |
| | | ProjectManage projectManage = new ProjectManage(); |
| | | projectManage.setProNum(proNum); |
| | | projectManage.setProNameCode(proNameCode); |
| | | projectManage.setProProgress(proProgress); |
| | | projectManage.setNote(proFilePath); |
| | | return service.updateManageState(projectManage); |
| | | } |
| | | |
| | | |
| | | @PutMapping("searchDoc") |
| | | @ApiOperation(notes = "项目管理-己确认阶段",value = "文档材料查询") |
| | | public Response searchDocumentation(@ApiParam(value = "项目编号", required = true) @RequestParam String proNum, |
| | | @ApiParam(value = "项目名称代码", required = true) @RequestParam String proNameCode){ |
| | | ProjectArchiveManage projectArchiveManage = new ProjectArchiveManage(); |
| | | projectArchiveManage.setProNum(proNum); |
| | | projectArchiveManage.setProNameCode(proNameCode); |
| | | return archiveManageService.searchDocumentation(projectArchiveManage); |
| | | |
| | | } |
| | | |
| | | @PutMapping("delDoc") |
| | | @ApiOperation(notes = "项目管理-己确认阶段",value = "文档材料删除") |
| | | public Response delDocumentation(@ApiParam(value = "项目编号", required = true) @RequestParam String proNum, |
| | | @ApiParam(value = "项目名称代码", required = true) @RequestParam String proNameCode, |
| | | @ApiParam(value = "文档路径", required = true) @RequestParam String proFilePath){ |
| | | ProjectArchiveManage projectArchiveManage = new ProjectArchiveManage(); |
| | | projectArchiveManage.setProNum(proNum); |
| | | projectArchiveManage.setProNameCode(proNameCode); |
| | | projectArchiveManage.setProFilePath(proFilePath); |
| | | return archiveManageService.delDocumentation(projectArchiveManage); |
| | | } |
| | | |
| | | @GetMapping("archiveAll") |
| | | @ApiOperation(value = "项目归档管理-查询所有") |
| | | public Response<List<ProjectManage>> searchArchiveAll() { |
| | | |
| | | return archiveManageService.searchAll(); |
| | | } |
| | | @GetMapping("archiveByCondition") |
| | | @ApiOperation(value = "项目归档管理-条件查询") |
| | | public Response searchArchiveByCondition(@ApiParam(value = "开始日期 格式 2021/01/28",required = true) @RequestParam Date gainDate, |
| | | @ApiParam(value = "归档日期",required = true)@RequestParam Date proArchiveDate, |
| | | @ApiParam(value = "项目类型",required = true)@RequestParam int proSort, |
| | | @ApiParam(value = "项目编号",required = true)@RequestParam String proNum) { |
| | | |
| | | ProjectArchiveManage pam = new ProjectArchiveManage(); |
| | | pam.setGainDate(gainDate); |
| | | pam.setProArchiveDate(proArchiveDate); |
| | | pam.setProSort(proSort); |
| | | pam.setProNum(proNum); |
| | | |
| | | return archiveManageService.searchArchiveByCondition(pam); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文件上传 |
| | | * achievement_name 成果类型 |
| | | */ |
| | | /* |
| | | @RequestMapping("/upload") |
| | | public Response upload(MultipartFile file) { |
| | | try { |
| | | if (file != null) { |
| | | File parentFile = createParentFile(); |
| | | String fileName = file.getOriginalFilename(); |
| | | String suffix = fileName.substring(fileName.lastIndexOf(".")); |
| | | String uuid = IdUtil.simpleUUID(); |
| | | fileName = uuid + suffix; |
| | | File imageFile = new File(parentFile, fileName); |
| | | FileUtil.writeFromStream(file.getInputStream(), imageFile); |
| | | */ |
| | | /** |
| | | * 年月日目录 |
| | | *//* |
| | | |
| | | String fileDay = DateUtil.thisYear() + "/" + (DateUtil.thisMonth() + 1) + "/" |
| | | + DateUtil.thisDayOfMonth(); |
| | | String imagePath = SystemConstant.FILE + "/document/" + fileDay + "/" + fileName; |
| | | */ |
| | | /** |
| | | * 实时转换 |
| | | *//* |
| | | |
| | | File toFile = new File(parentFile, uuid + ".pdf"); |
| | | documentConverter.convert(imageFile).to(toFile).execute(); |
| | | return Result.ok(imagePath); |
| | | } else { |
| | | return Result.error(); |
| | | } |
| | | } catch (Exception e) { |
| | | LOGGER.error("转换异常{}",e); |
| | | return Result.error(); |
| | | } |
| | | } |
| | | |
| | | */ |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.ProjectArchiveManage; |
| | | import com.whyc.pojo.ProjectManage; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProjectArchiveManageMapper { |
| | | int deleteByPrimaryKey(Integer num); |
| | | |
| | | int insert(ProjectArchiveManage record); |
| | | |
| | | int insertSelective(ProjectArchiveManage record); |
| | | |
| | | ProjectArchiveManage selectByPrimaryKey(Integer num); |
| | | |
| | | int updateByPrimaryKeySelective(ProjectArchiveManage record); |
| | | |
| | | int updateByPrimaryKey(ProjectArchiveManage record); |
| | | |
| | | List<ProjectArchiveManage> searchByCondition(ProjectArchiveManage projectArchiveManage); |
| | | |
| | | int delDocumentation(ProjectArchiveManage projectArchiveManage); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.ProjectManage; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProjectManageMapper { |
| | | int deleteByPrimaryKey(Integer num); |
| | | |
| | | int insert(ProjectManage record); |
| | | |
| | | int insertSelective(ProjectManage record); |
| | | |
| | | ProjectManage selectByPrimaryKey(Integer num); |
| | | |
| | | int updateByPrimaryKeySelective(ProjectManage record); |
| | | |
| | | int updateByPrimaryKey(ProjectManage record); |
| | | |
| | | //项目管理/项目过程管理 |
| | | List<ProjectManage> searchAll(); |
| | | |
| | | //项目管理/项目过程管理 查询 |
| | | List<ProjectManage> searchByCondition(ProjectManage projectManage); |
| | | |
| | | //项目管理/己确认、未确认阶段 管理-显示 |
| | | List<ProjectManage> searchManageStateByCondition(ProjectManage projectManage); |
| | | |
| | | //项目管理/己确认、未确认阶段 管理-更新 |
| | | int updateManageState(ProjectManage projectManage); |
| | | |
| | | //项目名称 唯一标识符 |
| | | Integer checkUniqueId(ProjectManage pm); |
| | | } |
New file |
| | |
| | | package com.whyc.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.ibatis.type.Alias; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * tb_project_archive_manage |
| | | * @author |
| | | */ |
| | | @Alias("ProjectArchiveManage") |
| | | @TableName(schema = "db_experiment",value = "tb_project_archive_manage") |
| | | public class ProjectArchiveManage implements Serializable { |
| | | private Integer num; |
| | | |
| | | /** |
| | | * 项目编号/对应多个文件 |
| | | */ |
| | | private String proNum; |
| | | |
| | | /** |
| | | * 项目名称 |
| | | */ |
| | | private String proName; |
| | | |
| | | /** |
| | | * 项目名称唯一识别码(200001010101 年月日时分秒 |
| | | */ |
| | | private String proNameCode; |
| | | |
| | | /** |
| | | * 项目类型 |
| | | */ |
| | | private Integer proSort; |
| | | |
| | | /** |
| | | * 立项材料/文档材料地址 |
| | | */ |
| | | private String proFilePath; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date proUploadDate; |
| | | |
| | | /** |
| | | * 预览文件名地址 |
| | | */ |
| | | private String proPdfFilePath; |
| | | |
| | | /** |
| | | * 文档名称 |
| | | */ |
| | | private String proDocumentName; |
| | | |
| | | /** |
| | | * 文档格式(后缀) |
| | | */ |
| | | private String proDocumentFormat; |
| | | |
| | | /** |
| | | * 归档日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date proArchiveDate; |
| | | |
| | | /** |
| | | * 成果名称 |
| | | */ |
| | | private String achievementName; |
| | | |
| | | /** |
| | | * 成果类型 |
| | | */ |
| | | private String achievementType; |
| | | |
| | | /** |
| | | * 取得/发表日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date gainDate; |
| | | |
| | | private String note; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public String getProNum() { |
| | | return proNum; |
| | | } |
| | | |
| | | public void setProNum(String proNum) { |
| | | this.proNum = proNum; |
| | | } |
| | | |
| | | public String getProName() { |
| | | return proName; |
| | | } |
| | | |
| | | public void setProName(String proName) { |
| | | this.proName = proName; |
| | | } |
| | | |
| | | public String getProNameCode() { |
| | | return proNameCode; |
| | | } |
| | | |
| | | public void setProNameCode(String proNameCode) { |
| | | this.proNameCode = proNameCode; |
| | | } |
| | | |
| | | public Integer getProSort() { |
| | | return proSort; |
| | | } |
| | | |
| | | public void setProSort(Integer proSort) { |
| | | this.proSort = proSort; |
| | | } |
| | | |
| | | public String getProFilePath() { |
| | | return proFilePath; |
| | | } |
| | | |
| | | public void setProFilePath(String proFilePath) { |
| | | this.proFilePath = proFilePath; |
| | | } |
| | | |
| | | public Date getProUploadDate() { |
| | | return proUploadDate; |
| | | } |
| | | |
| | | public void setProUploadDate(Date proUploadDate) { |
| | | this.proUploadDate = proUploadDate; |
| | | } |
| | | |
| | | public String getProPdfFilePath() { |
| | | return proPdfFilePath; |
| | | } |
| | | |
| | | public void setProPdfFilePath(String proPdfFilePath) { |
| | | this.proPdfFilePath = proPdfFilePath; |
| | | } |
| | | |
| | | public String getProDocumentName() { |
| | | return proDocumentName; |
| | | } |
| | | |
| | | public void setProDocumentName(String proDocumentName) { |
| | | this.proDocumentName = proDocumentName; |
| | | } |
| | | |
| | | public String getProDocumentFormat() { |
| | | return proDocumentFormat; |
| | | } |
| | | |
| | | public void setProDocumentFormat(String proDocumentFormat) { |
| | | this.proDocumentFormat = proDocumentFormat; |
| | | } |
| | | |
| | | public Date getProArchiveDate() { |
| | | return proArchiveDate; |
| | | } |
| | | |
| | | public void setProArchiveDate(Date proArchiveDate) { |
| | | this.proArchiveDate = proArchiveDate; |
| | | } |
| | | |
| | | public String getAchievementName() { |
| | | return achievementName; |
| | | } |
| | | |
| | | public void setAchievementName(String achievementName) { |
| | | this.achievementName = achievementName; |
| | | } |
| | | |
| | | public String getAchievementType() { |
| | | return achievementType; |
| | | } |
| | | |
| | | public void setAchievementType(String achievementType) { |
| | | this.achievementType = achievementType; |
| | | } |
| | | |
| | | public Date getGainDate() { |
| | | return gainDate; |
| | | } |
| | | |
| | | public void setGainDate(Date gainDate) { |
| | | this.gainDate = gainDate; |
| | | } |
| | | |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.ibatis.type.Alias; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * tb_project_manage |
| | | * @author |
| | | */ |
| | | @Alias("ProjectManage") |
| | | @TableName(schema = "db_experiment",value = "tb_project_manage") |
| | | public class ProjectManage implements Serializable { |
| | | private Integer num; |
| | | |
| | | /** |
| | | * 项目编号 |
| | | */ |
| | | private String proNum; |
| | | |
| | | /** |
| | | * 项目名称 |
| | | */ |
| | | private String proName; |
| | | |
| | | /** |
| | | * 项目名称唯一识别码(200001010101 年月日时分秒 |
| | | */ |
| | | @NotNull |
| | | private String proNameCode; |
| | | |
| | | /** |
| | | * 项目类型 |
| | | */ |
| | | private Integer proSort; |
| | | |
| | | /** |
| | | * 项目负责人 |
| | | */ |
| | | private String proAdmin; |
| | | |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | private String proTel; |
| | | |
| | | /** |
| | | * 立项日期/申报日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date proCreatedate; |
| | | |
| | | /** |
| | | * 执行日期/开始日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date proExecutionDate; |
| | | |
| | | /** |
| | | * 执行日期1/结束日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai") |
| | | private Date proExecutionDate1; |
| | | |
| | | /** |
| | | * 参与人员 |
| | | */ |
| | | private String proPerson; |
| | | |
| | | /** |
| | | * 经费预算 |
| | | */ |
| | | private Long proFunding; |
| | | |
| | | /** |
| | | * 经费来源 |
| | | */ |
| | | private String proFundingSource; |
| | | |
| | | /** |
| | | * 项目内容 |
| | | */ |
| | | private String proContent; |
| | | |
| | | /** |
| | | * 项目状态/进行中0-4,己结束5,己归档6 |
| | | */ |
| | | private Integer proState; |
| | | |
| | | /** |
| | | * 项目进度(0-6 立项、审批、研究、结题、验收、归档) |
| | | */ |
| | | private Integer proProgress; |
| | | |
| | | private String note; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public String getProNum() { |
| | | return proNum; |
| | | } |
| | | |
| | | public void setProNum(String proNum) { |
| | | this.proNum = proNum; |
| | | } |
| | | |
| | | public String getProName() { |
| | | return proName; |
| | | } |
| | | |
| | | public void setProName(String proName) { |
| | | this.proName = proName; |
| | | } |
| | | |
| | | public String getProNameCode() { |
| | | return proNameCode; |
| | | } |
| | | |
| | | public void setProNameCode(String proNameCode) { |
| | | this.proNameCode = proNameCode; |
| | | } |
| | | |
| | | public Integer getProSort() { |
| | | return proSort; |
| | | } |
| | | |
| | | public void setProSort(Integer proSort) { |
| | | this.proSort = proSort; |
| | | } |
| | | |
| | | public String getProAdmin() { |
| | | return proAdmin; |
| | | } |
| | | |
| | | public void setProAdmin(String proAdmin) { |
| | | this.proAdmin = proAdmin; |
| | | } |
| | | |
| | | public String getProTel() { |
| | | return proTel; |
| | | } |
| | | |
| | | public void setProTel(String proTel) { |
| | | this.proTel = proTel; |
| | | } |
| | | |
| | | public Date getProCreatedate() { |
| | | return proCreatedate; |
| | | } |
| | | |
| | | public void setProCreatedate(Date proCreatedate) { |
| | | this.proCreatedate = proCreatedate; |
| | | } |
| | | |
| | | public Date getProExecutionDate() { |
| | | return proExecutionDate; |
| | | } |
| | | |
| | | public void setProExecutionDate(Date proExecutionDate) { |
| | | this.proExecutionDate = proExecutionDate; |
| | | } |
| | | |
| | | public Date getProExecutionDate1() { |
| | | return proExecutionDate1; |
| | | } |
| | | |
| | | public void setProExecutionDate1(Date proExecutionDate1) { |
| | | this.proExecutionDate1 = proExecutionDate1; |
| | | } |
| | | |
| | | public String getProPerson() { |
| | | return proPerson; |
| | | } |
| | | |
| | | public void setProPerson(String proPerson) { |
| | | this.proPerson = proPerson; |
| | | } |
| | | |
| | | public Long getProFunding() { |
| | | return proFunding; |
| | | } |
| | | |
| | | public void setProFunding(Long proFunding) { |
| | | this.proFunding = proFunding; |
| | | } |
| | | |
| | | public String getProFundingSource() { |
| | | return proFundingSource; |
| | | } |
| | | |
| | | public void setProFundingSource(String proFundingSource) { |
| | | this.proFundingSource = proFundingSource; |
| | | } |
| | | |
| | | public String getProContent() { |
| | | return proContent; |
| | | } |
| | | |
| | | public void setProContent(String proContent) { |
| | | this.proContent = proContent; |
| | | } |
| | | |
| | | public Integer getProState() { |
| | | return proState; |
| | | } |
| | | |
| | | public void setProState(Integer proState) { |
| | | this.proState = proState; |
| | | } |
| | | |
| | | public Integer getProProgress() { |
| | | return proProgress; |
| | | } |
| | | |
| | | public void setProProgress(Integer proProgress) { |
| | | this.proProgress = proProgress; |
| | | } |
| | | |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ProjectArchiveManageMapper; |
| | | import com.whyc.pojo.ProjectArchiveManage; |
| | | import com.whyc.pojo.ProjectManage; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class ProjectArchiveManageService { |
| | | |
| | | @Resource |
| | | private ProjectArchiveManageMapper projectArchiveManageMapper; |
| | | |
| | | |
| | | public Response searchDocumentation(ProjectArchiveManage pam) { |
| | | |
| | | Response<Object> response = new Response<>(); |
| | | try { |
| | | List<ProjectArchiveManage> list = projectArchiveManageMapper.searchByCondition(pam); |
| | | ArrayList<Map<String, String>> list1 = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | ProjectArchiveManage projectArchiveManage = list.get(i); |
| | | map.put("文件名",projectArchiveManage.getProDocumentName()); |
| | | map.put("文件路径",projectArchiveManage.getProFilePath()); |
| | | list1.add(map); |
| | | } |
| | | response.setMsg(1,"查询成功"); |
| | | response.setData(list1); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return response.setMsg(0,"查询失败"); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | public Response delDocumentation(ProjectArchiveManage pam) { |
| | | Response<Object> response = new Response<>(); |
| | | try { |
| | | projectArchiveManageMapper.delDocumentation(pam); |
| | | File file = new File(pam.getProFilePath()); |
| | | if (file.exists()){ |
| | | file.delete(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return response.setMsg(0,"删除失败"); |
| | | } |
| | | response.setMsg(1,"删除成功"); |
| | | return response; |
| | | } |
| | | |
| | | public Response<List<ProjectManage>> searchAll() { |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public Response searchArchiveByCondition(ProjectArchiveManage projectArchiveManage) { |
| | | |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ProjectArchiveManageMapper; |
| | | import com.whyc.mapper.ProjectManageMapper; |
| | | import com.whyc.pojo.ProjectArchiveManage; |
| | | import com.whyc.pojo.ProjectManage; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.TransactionDefinition; |
| | | import org.springframework.transaction.TransactionStatus; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ProjectProcessManageService { |
| | | |
| | | @Autowired |
| | | DataSourceTransactionManager dataSourceTransactionManager; |
| | | @Autowired |
| | | TransactionDefinition transactionDefinition; |
| | | |
| | | @Resource |
| | | private ProjectManageMapper projectManageMapper; |
| | | |
| | | @Resource |
| | | private ProjectArchiveManageMapper projectArchiveManageMapper; |
| | | |
| | | |
| | | public Response<List<ProjectManage>> searchAll() { |
| | | Response<List<ProjectManage>> response = new Response<>(); |
| | | List<ProjectManage> projectManages = projectManageMapper.searchAll(); |
| | | response.setCode(1); |
| | | response.setData(projectManages); |
| | | return response; |
| | | } |
| | | |
| | | public Response<List<ProjectManage>> searchByCondition(ProjectManage projectManage) { |
| | | Response<List<ProjectManage>> response = new Response<>(); |
| | | List<ProjectManage> projectManages = projectManageMapper.searchByCondition(projectManage); |
| | | response.setCode(1); |
| | | response.setData(projectManages); |
| | | return response; |
| | | |
| | | } |
| | | |
| | | |
| | | public Response add(ProjectManage pm) { |
| | | Response response = new Response<>(); |
| | | Integer num = projectManageMapper.checkUniqueId(pm); |
| | | if(num>0){ |
| | | return response.setMsg(0, "添加失败,pro_name_code重复"); |
| | | } |
| | | boolean bl; |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | try { |
| | | bl = projectManageMapper.insert(pm) > 0; |
| | | if (bl) { |
| | | String[] paths = pm.getNote().split(";"); |
| | | for (int i = 0; i < paths.length; i++) { |
| | | ProjectArchiveManage pam = new ProjectArchiveManage(); |
| | | pam.setProNum(pm.getProNum()); |
| | | pam.setProName(pm.getProName()); |
| | | pam.setProNameCode(pm.getProNameCode());//唯一,可对应多个文件 |
| | | pam.setProSort(pm.getProSort()); |
| | | String path = paths[i]; |
| | | pam.setProFilePath(path); |
| | | String[] split = path.split("_"); |
| | | int rexIdex = split[1].lastIndexOf("."); |
| | | pam.setProDocumentName(split[1].substring(0, rexIdex)); |
| | | pam.setProDocumentFormat(split[1].substring(rexIdex + 1)); |
| | | pam.setProUploadDate(new Date()); |
| | | pam.setGainDate(new Date()); |
| | | projectArchiveManageMapper.insert(pam); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | dataSourceTransactionManager.rollback(transactionStatus); //事务回滚 |
| | | return response.setMsg(0, "添加失败"); |
| | | } |
| | | if (bl) { |
| | | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| | | response.setMsg(1, "添加成功"); |
| | | } else { |
| | | dataSourceTransactionManager.rollback(transactionStatus); //事务回滚 |
| | | response.setMsg(0, "添加失败"); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 项目管理 |
| | | * @param projectManage |
| | | * @return |
| | | */ |
| | | public Response<Object> searchManageStateByCondition(ProjectManage projectManage) { |
| | | Response response = new Response<>(); |
| | | |
| | | try { |
| | | List<ProjectManage> projectManages = projectManageMapper.searchManageStateByCondition(projectManage); |
| | | response.setCode(1); |
| | | response.setMsg(1,"查询成功"); |
| | | response.setData(projectManages); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return response.setMsg(0,"查询失败"); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 项目进度确认 |
| | | * |
| | | * @param pm |
| | | * @return |
| | | */ |
| | | public Response updateManageState(ProjectManage pm) { |
| | | Response response = new Response<>(); |
| | | boolean bl; |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | try { |
| | | bl = projectManageMapper.updateManageState(pm) > 0; |
| | | String path = pm.getNote().trim(); |
| | | if (path.length() > 10) { |
| | | ProjectArchiveManage pam = new ProjectArchiveManage(); |
| | | pam.setProNum(pm.getProNum()); |
| | | pam.setProName(pm.getProName()); |
| | | pam.setProNameCode(pm.getProNameCode());//唯一 |
| | | pam.setProSort(pm.getProSort()); |
| | | pam.setProFilePath(path); |
| | | String[] split = path.split("-"); |
| | | int rexIdex = split[1].lastIndexOf("."); |
| | | pam.setProDocumentName(split[1].substring(0, rexIdex)); |
| | | pam.setProDocumentFormat(split[1].substring(rexIdex + 1)); |
| | | projectArchiveManageMapper.insert(pam); |
| | | } |
| | | response.setMsg(1, "更新成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | return response.setMsg(0, "更新失败"); |
| | | } |
| | | if (bl) { |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | | } else { |
| | | |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | #数据库 |
| | | spring: |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 300MB |
| | | max-request-size: 500MB |
| | | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
New 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.whyc.mapper.ProjectArchiveManageMapper"> |
| | | <resultMap id="BaseResultMap" type="com.whyc.pojo.ProjectArchiveManage"> |
| | | <id column="num" jdbcType="INTEGER" property="num" /> |
| | | <result column="pro_num" jdbcType="INTEGER" property="proNum" /> |
| | | <result column="pro_name" jdbcType="VARCHAR" property="proName" /> |
| | | <result column="pro_name_code" jdbcType="VARCHAR" property="proNameCode" /> |
| | | <result column="pro_sort" jdbcType="INTEGER" property="proSort" /> |
| | | <result column="pro_file_path" jdbcType="VARCHAR" property="proFilePath" /> |
| | | <result column="pro_pdf_file_path" jdbcType="VARCHAR" property="proPdfFilePath" /> |
| | | <result column="pro_document_name" jdbcType="VARCHAR" property="proDocumentName" /> |
| | | <result column="pro_document_format" jdbcType="VARCHAR" property="proDocumentFormat" /> |
| | | <result column="pro_archive_date" jdbcType="DATE" property="proArchiveDate" /> |
| | | <result column="achievement_name" jdbcType="VARCHAR" property="achievementName" /> |
| | | <result column="achievement_type" jdbcType="VARCHAR" property="achievementType" /> |
| | | <result column="gain_date" jdbcType="DATE" property="gainDate" /> |
| | | <result column="note" jdbcType="VARCHAR" property="note" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | num, pro_num, pro_name, pro_name_code, pro_sort, pro_file_path, pro_pdf_file_path, |
| | | pro_document_name, pro_document_format, pro_archive_date, achievement_name, achievement_type, |
| | | gain_date, note |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from tb_project_archive_manage |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> |
| | | delete from tb_project_archive_manage |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="num" keyProperty="num" parameterType="com.whyc.pojo.ProjectArchiveManage" useGeneratedKeys="true"> |
| | | insert into tb_project_archive_manage (pro_num, pro_name, pro_name_code, |
| | | pro_sort, pro_file_path,pro_upload_date, pro_pdf_file_path, |
| | | pro_document_name, pro_document_format, pro_archive_date, |
| | | achievement_name, achievement_type, gain_date, |
| | | note) |
| | | values (#{proNum,jdbcType=INTEGER}, #{proName,jdbcType=VARCHAR}, #{proNameCode,jdbcType=VARCHAR}, |
| | | #{proSort,jdbcType=INTEGER}, #{proFilePath,jdbcType=VARCHAR},#{proUploadDate,jdbcType=DATE} ,#{proPdfFilePath,jdbcType=VARCHAR}, |
| | | #{proDocumentName,jdbcType=VARCHAR}, #{proDocumentFormat,jdbcType=VARCHAR}, #{proArchiveDate,jdbcType=DATE}, |
| | | #{achievementName,jdbcType=VARCHAR}, #{achievementType,jdbcType=VARCHAR}, #{gainDate,jdbcType=DATE}, |
| | | #{note,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="num" keyProperty="num" parameterType="com.whyc.pojo.ProjectArchiveManage" useGeneratedKeys="true"> |
| | | insert into tb_project_archive_manage |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="proNum != null"> |
| | | pro_num, |
| | | </if> |
| | | <if test="proName != null"> |
| | | pro_name, |
| | | </if> |
| | | <if test="proNameCode != null"> |
| | | pro_name_code, |
| | | </if> |
| | | <if test="proSort != null"> |
| | | pro_sort, |
| | | </if> |
| | | <if test="proFilePath != null"> |
| | | pro_file_path, |
| | | </if> |
| | | <if test="proPdfFilePath != null"> |
| | | pro_pdf_file_path, |
| | | </if> |
| | | <if test="proDocumentName != null"> |
| | | pro_document_name, |
| | | </if> |
| | | <if test="proDocumentFormat != null"> |
| | | pro_document_format, |
| | | </if> |
| | | <if test="proArchiveDate != null"> |
| | | pro_archive_date, |
| | | </if> |
| | | <if test="achievementName != null"> |
| | | achievement_name, |
| | | </if> |
| | | <if test="achievementType != null"> |
| | | achievement_type, |
| | | </if> |
| | | <if test="gainDate != null"> |
| | | gain_date, |
| | | </if> |
| | | <if test="note != null"> |
| | | note, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="proNum != null"> |
| | | #{proNum,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proName != null"> |
| | | #{proName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proNameCode != null"> |
| | | #{proNameCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proSort != null"> |
| | | #{proSort,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proFilePath != null"> |
| | | #{proFilePath,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proPdfFilePath != null"> |
| | | #{proPdfFilePath,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proDocumentName != null"> |
| | | #{proDocumentName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proDocumentFormat != null"> |
| | | #{proDocumentFormat,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proArchiveDate != null"> |
| | | #{proArchiveDate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="achievementName != null"> |
| | | #{achievementName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="achievementType != null"> |
| | | #{achievementType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="gainDate != null"> |
| | | #{gainDate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="note != null"> |
| | | #{note,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.ProjectArchiveManage"> |
| | | update tb_project_archive_manage |
| | | <set> |
| | | <if test="proNum != null"> |
| | | pro_num = #{proNum,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proName != null"> |
| | | pro_name = #{proName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proNameCode != null"> |
| | | pro_name_code = #{proNameCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proSort != null"> |
| | | pro_sort = #{proSort,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proFilePath != null"> |
| | | pro_file_path = #{proFilePath,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proPdfFilePath != null"> |
| | | pro_pdf_file_path = #{proPdfFilePath,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proDocumentName != null"> |
| | | pro_document_name = #{proDocumentName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proDocumentFormat != null"> |
| | | pro_document_format = #{proDocumentFormat,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proArchiveDate != null"> |
| | | pro_archive_date = #{proArchiveDate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="achievementName != null"> |
| | | achievement_name = #{achievementName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="achievementType != null"> |
| | | achievement_type = #{achievementType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="gainDate != null"> |
| | | gain_date = #{gainDate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="note != null"> |
| | | note = #{note,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.ProjectArchiveManage"> |
| | | update tb_project_archive_manage |
| | | set pro_num = #{proNum,jdbcType=INTEGER}, |
| | | pro_name = #{proName,jdbcType=VARCHAR}, |
| | | pro_name_code = #{proNameCode,jdbcType=VARCHAR}, |
| | | pro_sort = #{proSort,jdbcType=INTEGER}, |
| | | pro_file_path = #{proFilePath,jdbcType=VARCHAR}, |
| | | pro_pdf_file_path = #{proPdfFilePath,jdbcType=VARCHAR}, |
| | | pro_document_name = #{proDocumentName,jdbcType=VARCHAR}, |
| | | pro_document_format = #{proDocumentFormat,jdbcType=VARCHAR}, |
| | | pro_archive_date = #{proArchiveDate,jdbcType=DATE}, |
| | | achievement_name = #{achievementName,jdbcType=VARCHAR}, |
| | | achievement_type = #{achievementType,jdbcType=VARCHAR}, |
| | | gain_date = #{gainDate,jdbcType=DATE}, |
| | | note = #{note,jdbcType=VARCHAR} |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | <select id="searchByCondition" resultType="com.whyc.pojo.ProjectArchiveManage"> |
| | | SELECT * |
| | | FROM db_experiment.tb_project_archive_manage |
| | | WHERE pro_num = #{proNum} |
| | | and pro_name_code = #{proNameCode} |
| | | </select> |
| | | |
| | | <delete id="delDocumentation"> |
| | | DELETE |
| | | FROM db_experiment.tb_project_archive_manage |
| | | WHERE pro_num = #{proNum} |
| | | and pro_name_code = #{proNameCode} and pro_file_path = #{proNameCode} |
| | | </delete> |
| | | |
| | | </mapper> |
New 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.whyc.mapper.ProjectManageMapper"> |
| | | <resultMap id="BaseResultMap" type="com.whyc.pojo.ProjectManage"> |
| | | <id column="num" jdbcType="INTEGER" property="num" /> |
| | | <result column="pro_num" jdbcType="INTEGER" property="proNum" /> |
| | | <result column="pro_name" jdbcType="VARCHAR" property="proName" /> |
| | | <result column="pro_name_code" jdbcType="VARCHAR" property="proNameCode" /> |
| | | <result column="pro_sort" jdbcType="INTEGER" property="proSort" /> |
| | | <result column="pro_admin" jdbcType="VARCHAR" property="proAdmin" /> |
| | | <result column="pro_tel" jdbcType="INTEGER" property="proTel" /> |
| | | <result column="pro_createdate" jdbcType="DATE" property="proCreatedate" /> |
| | | <result column="pro_execution_date" jdbcType="DATE" property="proExecutionDate" /> |
| | | <result column="pro_execution_date1" jdbcType="DATE" property="proExecutionDate1" /> |
| | | <result column="pro_person" jdbcType="VARCHAR" property="proPerson" /> |
| | | <result column="pro_funding" jdbcType="DECIMAL" property="proFunding" /> |
| | | <result column="pro_funding_source" jdbcType="VARCHAR" property="proFundingSource" /> |
| | | <result column="pro_content" jdbcType="VARCHAR" property="proContent" /> |
| | | <result column="pro_state" jdbcType="INTEGER" property="proState" /> |
| | | <result column="pro_progress" jdbcType="VARCHAR" property="proProgress" /> |
| | | <result column="note" jdbcType="VARCHAR" property="note" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | num, pro_num, pro_name, pro_name_code, pro_sort, pro_admin, pro_tel, pro_createdate, |
| | | pro_execution_date, pro_execution_date1, pro_person, pro_funding, pro_funding_source, |
| | | pro_content, pro_state, pro_progress, note |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from tb_project_manage |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> |
| | | delete from tb_project_manage |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="num" keyProperty="num" parameterType="com.whyc.pojo.ProjectManage" useGeneratedKeys="true"> |
| | | insert into tb_project_manage (pro_num, pro_name, pro_name_code, |
| | | pro_sort, pro_admin, pro_tel, |
| | | pro_createdate, pro_execution_date, pro_execution_date1, |
| | | pro_person, pro_funding, pro_funding_source, |
| | | pro_content, pro_state, pro_progress, |
| | | note) |
| | | values (#{proNum,jdbcType=INTEGER}, #{proName,jdbcType=VARCHAR}, #{proNameCode,jdbcType=VARCHAR}, |
| | | #{proSort,jdbcType=INTEGER}, #{proAdmin,jdbcType=VARCHAR}, #{proTel,jdbcType=INTEGER}, |
| | | #{proCreatedate,jdbcType=DATE}, #{proExecutionDate,jdbcType=DATE}, #{proExecutionDate1,jdbcType=DATE}, |
| | | #{proPerson,jdbcType=VARCHAR}, #{proFunding,jdbcType=DECIMAL}, #{proFundingSource,jdbcType=VARCHAR}, |
| | | #{proContent,jdbcType=VARCHAR}, #{proState,jdbcType=INTEGER}, #{proProgress,jdbcType=VARCHAR}, |
| | | #{note,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="num" keyProperty="num" parameterType="com.whyc.pojo.ProjectManage" useGeneratedKeys="true"> |
| | | insert into tb_project_manage |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="proNum != null"> |
| | | pro_num, |
| | | </if> |
| | | <if test="proName != null"> |
| | | pro_name, |
| | | </if> |
| | | <if test="proNameCode != null"> |
| | | pro_name_code, |
| | | </if> |
| | | <if test="proSort != null"> |
| | | pro_sort, |
| | | </if> |
| | | <if test="proAdmin != null"> |
| | | pro_admin, |
| | | </if> |
| | | <if test="proTel != null"> |
| | | pro_tel, |
| | | </if> |
| | | <if test="proCreatedate != null"> |
| | | pro_createdate, |
| | | </if> |
| | | <if test="proExecutionDate != null"> |
| | | pro_execution_date, |
| | | </if> |
| | | <if test="proExecutionDate1 != null"> |
| | | pro_execution_date1, |
| | | </if> |
| | | <if test="proPerson != null"> |
| | | pro_person, |
| | | </if> |
| | | <if test="proFunding != null"> |
| | | pro_funding, |
| | | </if> |
| | | <if test="proFundingSource != null"> |
| | | pro_funding_source, |
| | | </if> |
| | | <if test="proContent != null"> |
| | | pro_content, |
| | | </if> |
| | | <if test="proState != null"> |
| | | pro_state, |
| | | </if> |
| | | <if test="proProgress != null"> |
| | | pro_progress, |
| | | </if> |
| | | <if test="note != null"> |
| | | note, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="proNum != null"> |
| | | #{proNum,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proName != null"> |
| | | #{proName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proNameCode != null"> |
| | | #{proNameCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proSort != null"> |
| | | #{proSort,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proAdmin != null"> |
| | | #{proAdmin,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proTel != null"> |
| | | #{proTel,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proCreatedate != null"> |
| | | #{proCreatedate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="proExecutionDate != null"> |
| | | #{proExecutionDate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="proExecutionDate1 != null"> |
| | | #{proExecutionDate1,jdbcType=DATE}, |
| | | </if> |
| | | <if test="proPerson != null"> |
| | | #{proPerson,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proFunding != null"> |
| | | #{proFunding,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="proFundingSource != null"> |
| | | #{proFundingSource,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proContent != null"> |
| | | #{proContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proState != null"> |
| | | #{proState,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proProgress != null"> |
| | | #{proProgress,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="note != null"> |
| | | #{note,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.ProjectManage"> |
| | | update tb_project_manage |
| | | <set> |
| | | <if test="proNum != null"> |
| | | pro_num = #{proNum,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proName != null"> |
| | | pro_name = #{proName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proNameCode != null"> |
| | | pro_name_code = #{proNameCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proSort != null"> |
| | | pro_sort = #{proSort,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proAdmin != null"> |
| | | pro_admin = #{proAdmin,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proTel != null"> |
| | | pro_tel = #{proTel,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proCreatedate != null"> |
| | | pro_createdate = #{proCreatedate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="proExecutionDate != null"> |
| | | pro_execution_date = #{proExecutionDate,jdbcType=DATE}, |
| | | </if> |
| | | <if test="proExecutionDate1 != null"> |
| | | pro_execution_date1 = #{proExecutionDate1,jdbcType=DATE}, |
| | | </if> |
| | | <if test="proPerson != null"> |
| | | pro_person = #{proPerson,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proFunding != null"> |
| | | pro_funding = #{proFunding,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="proFundingSource != null"> |
| | | pro_funding_source = #{proFundingSource,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proContent != null"> |
| | | pro_content = #{proContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="proState != null"> |
| | | pro_state = #{proState,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="proProgress != null"> |
| | | pro_progress = #{proProgress,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="note != null"> |
| | | note = #{note,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.ProjectManage"> |
| | | update tb_project_manage |
| | | set pro_num = #{proNum,jdbcType=INTEGER}, |
| | | pro_name = #{proName,jdbcType=VARCHAR}, |
| | | pro_name_code = #{proNameCode,jdbcType=VARCHAR}, |
| | | pro_sort = #{proSort,jdbcType=INTEGER}, |
| | | pro_admin = #{proAdmin,jdbcType=VARCHAR}, |
| | | pro_tel = #{proTel,jdbcType=INTEGER}, |
| | | pro_createdate = #{proCreatedate,jdbcType=DATE}, |
| | | pro_execution_date = #{proExecutionDate,jdbcType=DATE}, |
| | | pro_execution_date1 = #{proExecutionDate1,jdbcType=DATE}, |
| | | pro_person = #{proPerson,jdbcType=VARCHAR}, |
| | | pro_funding = #{proFunding,jdbcType=DECIMAL}, |
| | | pro_funding_source = #{proFundingSource,jdbcType=VARCHAR}, |
| | | pro_content = #{proContent,jdbcType=VARCHAR}, |
| | | pro_state = #{proState,jdbcType=INTEGER}, |
| | | pro_progress = #{proProgress,jdbcType=VARCHAR}, |
| | | note = #{note,jdbcType=VARCHAR} |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateManageState"> |
| | | update tb_project_manage |
| | | set pro_progress = #{proProgress,jdbcType=VARCHAR} |
| | | where pro_num = #{proNum} and pro_name_code = #{proNameCode} |
| | | </update> |
| | | |
| | | <select id="searchAll" resultType="com.whyc.pojo.ProjectManage"> |
| | | SELECT * FROM db_experiment.tb_project_manage |
| | | </select> |
| | | <select id="searchByCondition" resultType="com.whyc.pojo.ProjectManage"> |
| | | SELECT * |
| | | FROM db_experiment.tb_project_manage |
| | | where pro_createdate = #{proCreatedate} |
| | | and pro_sort = #{proSort} |
| | | and pro_state = #{proState} |
| | | and pro_num = #{proNum} |
| | | </select> |
| | | <select id="searchManageStateByCondition" resultType="com.whyc.pojo.ProjectManage"> |
| | | SELECT * |
| | | FROM db_experiment.tb_project_manage |
| | | where pro_num = #{proNum} |
| | | and pro_name_code = #{proNameCode} |
| | | </select> |
| | | <select id="checkUniqueId" resultType="java.lang.Integer"> |
| | | SELECT count(*) num |
| | | FROM db_experiment.tb_project_manage |
| | | where pro_name_code = #{proNameCode} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |