| | |
| | | * 行业类型列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "行业类型列表") |
| | | @ApiOperation(value = "行业类型列表分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10") |
| | |
| | | return CommonResult.success(service.selectIndustryTypeList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "行业类型列表") |
| | | @GetMapping("/listAll") |
| | | public CommonResult listIndustryTypeAll(){ |
| | | return CommonResult.success(service.selectList()); |
| | |
| | | public CommonResult deletedCatalogueData(@RequestParam("catalogueDataId") Integer catalogueDataId){ |
| | | return catalogueService.deletedCatalogueData(catalogueDataId); |
| | | } |
| | | // |
| | | // /** |
| | | // * 目录数据文件列表 |
| | | // * @param catalogueReq |
| | | // * @return |
| | | // */ |
| | | // @ApiOperation(value = "目录数据文件列表") |
| | | // @GetMapping("/catalogueData/list") |
| | | // public CommonResult listCatalogueDataFile(CatalogueReq catalogueReq){ |
| | | // return CommonResult.success(catalogueService.selectCatalogueDataList(catalogueReq)); |
| | | // } |
| | | |
| | | /** |
| | | * 目录数据文件列表 |
| | | * @param catalogueReq |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "目录数据文件列表") |
| | | @GetMapping("/catalogueDataFile/list") |
| | | public CommonResult listCatalogueDataFile(CatalogueReq catalogueReq){ |
| | | return CommonResult.success(catalogueService.selectCatalogueDataFileList(catalogueReq)); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | @Data |
| | | public class CatalogueDataReq { |
| | | |
| | | private String id; |
| | | private Integer id; |
| | | |
| | | private Integer catalogueId; |
| | | private Integer companyId; |
| | |
| | | |
| | | List<CatalogueDataFile> selectCatalogueDataFile(@Param("companyId") Integer companyId, @Param("catalogueId") Integer catalogueId); |
| | | |
| | | List<CatalogueData> selectByCompanyId(Integer companyId); |
| | | List<CatalogueData> selectByCompanyId(@Param("companyId") Integer companyId, @Param("catalogueId") Integer catalogueId); |
| | | |
| | | CatalogueData selectCatalogueDataById(@Param("catalogueDataId") Integer catalogueDataId); |
| | | |
| | | void updateCatalogueDataFileByCompanyId(CatalogueDataFile catalogueDataFile); |
| | | } |
| | |
| | | CommonResult updateCatalogueDataFile(CatalogueDataFile catalogueDataFile); |
| | | |
| | | CommonResult deletedCatalogueDataFile(Integer dataFileId); |
| | | |
| | | CommonResult selectCatalogueDataFileList(CatalogueReq catalogueReq); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public CommonResult insertCatalogueData(CatalogueDataReq catalogue) { |
| | | List<CatalogueData> catalogueData1 = catalogueMapper.selectByCompanyId(catalogue.getCompanyId()); |
| | | //校验 |
| | | List<CatalogueData> catalogueData1 = catalogueMapper.selectByCompanyId(catalogue.getCompanyId(),catalogue.getCatalogueId()); |
| | | if (catalogueData1.size()>0){ |
| | | return CommonResult.failed("当前企业已有数据,请勿重复添加"); |
| | | } |
| | | CatalogueData catalogueData = new CatalogueData(); |
| | | BeanUtils.copyProperties(catalogue,catalogueData); |
| | | catalogueData.setCreateBy(SecurityUtils.getUsername()); |
| | | catalogueData.setCreateTime(LocalDate.now()); |
| | | //新增数据 |
| | | Integer i = catalogueMapper.insertCatalogueData(catalogueData); |
| | | // List<CatalogueDataFile> files = catalogue.getFiles(); |
| | | if (i>0){ |
| | |
| | | |
| | | @Override |
| | | public CommonResult deletedCatalogueData(Integer catalogueDataId) { |
| | | //删除数据所属文件 |
| | | CatalogueData catalogue = catalogueMapper.selectCatalogueDataById(catalogueDataId); |
| | | CatalogueDataFile catalogueDataFile = new CatalogueDataFile(); |
| | | catalogueDataFile.setCompanyId(catalogue.getCompanyId()); |
| | | catalogueDataFile.setCatalogueId(catalogue.getCatalogueId()); |
| | | catalogueDataFile.setDelFlag(2); |
| | | catalogueDataFile.setUpdateTime(LocalDate.now()); |
| | | catalogueDataFile.setUpdateBy(SecurityUtils.getUsername()); |
| | | catalogueMapper.updateCatalogueDataFileByCompanyId(catalogueDataFile); |
| | | //删除数据 |
| | | CatalogueData catalogueData = new CatalogueData(); |
| | | catalogueData.setId(catalogueDataId); |
| | | catalogueData.setDelFlag(2); |
| | | catalogueData.setUpdateBy(SecurityUtils.getUsername()); |
| | | catalogueData.setUpdateTime(LocalDate.now()); |
| | | Integer i = catalogueMapper.updateCatalogueData(catalogueData); |
| | | if (i>9){ |
| | | if (i>0){ |
| | | return CommonResult.success(); |
| | | } |
| | | return CommonResult.failed(); |
| | |
| | | catalogueMapper.updateCatalogueDataFile(catalogueDataFile); |
| | | return CommonResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult selectCatalogueDataFileList(CatalogueReq catalogueReq) { |
| | | return CommonResult.success(catalogueMapper.selectCatalogueDataFile(catalogueReq.getCompanyId(),catalogueReq.getCatalogueId())); |
| | | } |
| | | } |
| | |
| | | |
| | | <update id="updateCatalogueData"> |
| | | UPDATE `catalogue_data` |
| | | SET |
| | | <set> |
| | | <if test="companyId!=null"> |
| | | `company_id` = #{companyId}, |
| | | </if> |
| | |
| | | <if test="content!=null and content!=''"> |
| | | `content` = #{content}, |
| | | </if> |
| | | <if test="analysic!=null and analysic!=''"> |
| | | <if test="analysis!=null and analysis!=''"> |
| | | `analysis` = #{analysis}, |
| | | </if> |
| | | <if test="delFlag!=null and delFlag!=''"> |
| | | `del_flag` = #{delFlag}, |
| | | </if> |
| | | <if test="updateBy!=null and update!=''"> |
| | | <if test="updateBy!=null and updateBy!=''"> |
| | | `update_by` = #{updateBy}, |
| | | </if> |
| | | <if test="updateTime!=null"> |
| | | `update_time` = #{updateTime} |
| | | </if> |
| | | </set> |
| | | WHERE |
| | | `id` = #{id} |
| | | </update> |
| | | <update id="updateCatalogueDataFile"> |
| | | UPDATE `catalogue_data_file` |
| | | set |
| | | <set> |
| | | <if test="catalogueId!=null"> |
| | | `catalogue_id` = #{catalogueId}, |
| | | </if> |
| | |
| | | <if test="updateTime != null" > |
| | | update_time = #{updateTime} |
| | | </if> |
| | | </set> |
| | | where id = #{id} |
| | | </update> |
| | | <update id="updateCatalogueDataFileByCompanyId"> |
| | | UPDATE catalogue_data_file set del_flag = #{delFlag} ,update_by = #{updateBy} , update_time=#{updateTime} where company_id =#{companyId} and catalogue_id = #{catalogueId} |
| | | </update> |
| | | |
| | | <select id="selectCatalogueList" resultType="com.gkhy.exam.system.domain.vo.CatalogueVo"> |
| | |
| | | SELECT |
| | | `id`, |
| | | `company_id`, |
| | | name, |
| | | `catalogue_id`, |
| | | `content`, |
| | | `analysis`, |
| | |
| | | `update_time` |
| | | FROM |
| | | catalogue_data |
| | | where company_id = #{companyId} and del_flag = 1 |
| | | where company_id = #{companyId} and del_flag = 1 and catalogue_id = #{catalogueId} |
| | | |
| | | </select> |
| | | <select id="selectCatalogueDataById" resultType="com.gkhy.exam.system.domain.CatalogueData"> |
| | | SELECT |
| | | `id`, |
| | | `company_id`, |
| | | `catalogue_id`, |
| | | `content`, |
| | | `analysis`, |
| | | `del_flag`, |
| | | `create_by`, |
| | | `create_time`, |
| | | `update_by`, |
| | | `update_time` |
| | | FROM |
| | | catalogue_data where del_flag = 1 and id=#{catalogueDataId} |
| | | </select> |
| | | </mapper> |