| | |
| | | |
| | | /** |
| | | * 行业模版 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "标准化模版(分页)") |
| | |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司iD"), |
| | | @ApiImplicitParam(paramType = "query", name = "templateType", dataType = "int", required = true, value = "类型1体系标准2技术标准3应用标准4程序文件5作业指导书6记录及表单7技术类8生产类9其他知识产权"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = true, value = "页码"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = true, value = "每页数量") |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = true, value = "每页数量"), |
| | | @ApiImplicitParam(paramType = "query", name = "sort", dataType = "int", required = true, value = "排序类型1正序2倒序"), |
| | | @ApiImplicitParam(paramType = "query", name = "templateName", dataType = "string", required = false, value = "模板名称") |
| | | }) |
| | | @GetMapping("/standardizedTemplate/list") |
| | | public CommonResult selectStandardizedTemplateList(Integer companyId, @RequestParam("templateType") Integer templateType){ |
| | | return CommonResult.success(standardizedTemplateService.selectStandardizedTemplateList(companyId, templateType)); |
| | | public CommonResult selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate){ |
| | | return CommonResult.success(standardizedTemplateService.selectStandardizedTemplateList(standardizedTemplate)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("排序1正序2倒序") |
| | | @TableField(exist = false) |
| | | private Integer sort; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.exam.system.domain.CompanyIndustryTemplate; |
| | | import com.gkhy.exam.system.domain.StandardizedTemplate; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.mapstruct.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface StandardizedTemplateMapper extends BaseMapper<StandardizedTemplate> { |
| | | List<StandardizedTemplate> selectStandardizedTemplateList(Integer companyId, Integer templateType); |
| | | // List<StandardizedTemplate> selectStandardizedTemplateList(@Param("companyId") Integer companyId, @Param("templateType") Integer templateType ,@Param("sort") Integer sort); |
| | | // |
| | | // List<StandardizedTemplate> selectStandardizedTemplateListV2(@Param("companyId")Integer companyId, @Param("templateType")Integer templateType, |
| | | // @Param("industryTypeId")Integer industryTypeId,@Param("sort") Integer sort); |
| | | |
| | | List<StandardizedTemplate> selectStandardizedTemplateListV2(Integer companyId, Integer templateType, Integer industryTypeId); |
| | | |
| | | List<StandardizedTemplate> selectStandardizedTemplateList(StandardizedTemplate template); |
| | | |
| | | List<StandardizedTemplate> selectStandardizedTemplateListV2(StandardizedTemplate template); |
| | | |
| | | int updateStandardizedTemplateById(StandardizedTemplate template); |
| | | } |
| | |
| | | import com.gkhy.exam.system.domain.StandardizedTemplate; |
| | | |
| | | public interface StandardizedTemplateService extends IService<StandardizedTemplate> { |
| | | CommonPage selectStandardizedTemplateList(Integer companyId,Integer templateType); |
| | | CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate); |
| | | |
| | | CommonResult insertStandardizedTemplate(StandardizedTemplate standardizedTemplate); |
| | | |
| | |
| | | @Autowired |
| | | private CustomerService customerService; |
| | | @Override |
| | | public CommonPage selectStandardizedTemplateList(Integer companyId, Integer templateType) { |
| | | public CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate) { |
| | | boolean admin = SecurityUtils.adminUser(); |
| | | Integer companyId = standardizedTemplate.getCompanyId(); |
| | | Integer templateType = standardizedTemplate.getTemplateType(); |
| | | if (!admin){ |
| | | if (companyId==null){ |
| | | companyId = SecurityUtils.getCompanyId().intValue(); |
| | |
| | | } |
| | | PageUtils.startPage(); |
| | | List<StandardizedTemplate> standardizedTemplates =new ArrayList<>(); |
| | | if (templateType==2 || templateType==10 || templateType == 3){ |
| | | standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateListV2(companyId, templateType, null); |
| | | //templateType==2 || templateType==10 || |
| | | if ( templateType == 3){ |
| | | standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateListV2(standardizedTemplate); |
| | | }else { |
| | | standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(companyId, templateType); |
| | | standardizedTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(standardizedTemplate); |
| | | } |
| | | |
| | | return CommonPage.restPage(standardizedTemplates); |
| | |
| | | public CommonResult getStandardizedQualityByCompanyId(Integer companyId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //程序文件 |
| | | List<StandardizedTemplate> companyIndustryTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(companyId, 4); |
| | | StandardizedTemplate programFile = new StandardizedTemplate(); |
| | | programFile.setTemplateType(4); |
| | | programFile.setCompanyId(companyId); |
| | | programFile.setSort(1); |
| | | List<StandardizedTemplate> companyIndustryTemplates = standardizedTemplateMapper.selectStandardizedTemplateList(programFile); |
| | | //职能分配 |
| | | List<SysFunctionalDistribution> sysFunctionalDistributions = sysFunctionalDistributionMapper.selectListVo(companyId.longValue()); |
| | | //部门 |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate"> |
| | | <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate"> |
| | | SELECT |
| | | st.`id`, |
| | | st.`company_id`, |
| | |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and st.company_id = #{companyId} |
| | | </if> |
| | | <if test="templateName!=null and templateName!=''"> |
| | | and st.template_name like concat('%',#{templateName},'%') |
| | | </if> |
| | | <if test="sort!=null and sort==1"> |
| | | ORDER BY |
| | | st.create_time DESC |
| | | st.template_name asc |
| | | </if> |
| | | <if test="sort!=null and sort==2"> |
| | | ORDER BY |
| | | st.template_name desc |
| | | </if> |
| | | <if test="sort ==null or sort== '' or sort == 0"> |
| | | ORDER BY |
| | | st.create_time desc |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate"> |
| | | <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate"> |
| | | SELECT |
| | | st.`id`, |
| | | st.`company_id`, |
| | |
| | | <if test="industryTypeId!=null "> |
| | | and st.industry_type_id = #{industryTypeId} |
| | | </if> |
| | | <if test="templateName!=null and templateName!=''"> |
| | | and st.template_name like concat('%',#{templateName},'%') |
| | | </if> |
| | | <if test="sort!=null and sort==1"> |
| | | ORDER BY |
| | | st.create_time DESC |
| | | st.template_name asc |
| | | </if> |
| | | <if test="sort!=null and sort==2"> |
| | | ORDER BY |
| | | st.template_name desc |
| | | </if> |
| | | <if test="sort ==null or sort== '' or sort == 0"> |
| | | ORDER BY |
| | | st.create_time desc |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |