| | |
| | | @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"), |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id"), |
| | | @ApiImplicitParam(paramType = "query", name = "year", dataType = "String", required = false, value = "年份"), |
| | | }) |
| | | @GetMapping("/selectManagementPlanList") |
| | | public CommonResult selectManagementPlanList(Integer companyId){ |
| | | return CommonResult.success(managementPlanService.selectManagementPlanList(companyId)); |
| | | public CommonResult selectManagementPlanList(ManagementPlan managementPlan){ |
| | | return CommonResult.success(managementPlanService.selectManagementPlanList(managementPlan)); |
| | | } |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "新增管理审批计划") |
| | |
| | | */ |
| | | @Mapper |
| | | public interface ManagementPlanMapper extends BaseMapper<ManagementPlan> { |
| | | List<ManagementPlan> selectManagementPlanById(Integer companyId); |
| | | List<ManagementPlan> selectManagementPlanById(ManagementPlan managementPlan); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface ManagementPlanService extends IService<ManagementPlan> { |
| | | |
| | | CommonPage selectManagementPlanList(Integer companyId); |
| | | CommonPage selectManagementPlanList(ManagementPlan managementPlan); |
| | | |
| | | CommonResult insertManagementPlan(ManagementPlan managementPlan); |
| | | |
| | |
| | | private ManagementPlanMapper managementPlanMapper; |
| | | |
| | | @Override |
| | | public CommonPage selectManagementPlanList(Integer companyId) { |
| | | public CommonPage selectManagementPlanList(ManagementPlan managementPlan) { |
| | | PageUtils.startPage(); |
| | | List<ManagementPlan> managementPlans = managementPlanMapper.selectManagementPlanById(companyId); |
| | | List<ManagementPlan> managementPlans = managementPlanMapper.selectManagementPlanById(managementPlan); |
| | | return CommonPage.restPage(managementPlans); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult insertManagementPlan(ManagementPlan managementPlan) { |
| | | List<ManagementPlan> managementPlans = managementPlanMapper.selectManagementPlanById(managementPlan.getCompanyId()); |
| | | if (managementPlan == null || managementPlan.getCompanyId() == null){ |
| | | return CommonResult.failed("企业id不能为空"); |
| | | } |
| | | List<ManagementPlan> managementPlans = managementPlanMapper.selectManagementPlanById(managementPlan); |
| | | if (ObjectUtil.isNotEmpty(managementPlans)) { |
| | | return CommonResult.failed("当前企业已有数据,请勿重复添加"); |
| | | } |
| | |
| | | <?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.gkhy.exam.system.mapper.ManagementPlanMapper"> |
| | | <select id="selectManagementPlanById" resultType="com.gkhy.exam.system.domain.ManagementPlan"> |
| | | <select id="selectManagementPlanById" resultType="com.gkhy.exam.system.domain.ManagementPlan" parameterType="com.gkhy.exam.system.domain.ManagementPlan"> |
| | | select * from management_plan where del_flag=0 |
| | | <if test="companyId != null"> |
| | | and company_id = #{companyId} |
| | | </if> |
| | | <if test="year != null and year != ''"> |
| | | and year = #{year} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | |