修改新增计划企业

zhangtao
dongdingding 1 year ago
parent 16f7227d48
commit a01fb1b3f0

@ -4,6 +4,7 @@ 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.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
@ -125,14 +126,14 @@ public class BPlanEnterpriseController extends BaseController {
/**
*
*
* @param bPlanEnterprise
* @param req
* @return
*/
@PutMapping
@ApiOperation(value = "修改计划企业表")
public AjaxResult update(@RequestBody BPlanEnterpriseRequest bPlanEnterprise) {
return success(bPlanEnterpriseService.updateById(bPlanEnterprise));
public AjaxResult update(@RequestBody BPlanEnterpriseRequest req) {
bPlanEnterpriseService.updatePlan(req);
return success();
}
/**

@ -114,6 +114,9 @@ public class BPlanEnterprise extends BaseEntity {
@ApiModelProperty(value = "计划月份")
private String[] plannedMonth;
@TableField(javaType = true)
private String plannedMonthStr;
/**
*

@ -14,7 +14,7 @@ import java.util.List;
* @author wu
* @since 2023-09-07 09:43:06
*/
public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterpriseRequest> {
public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
/**
@ -113,5 +113,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterpriseRequest
*/
void insertPlan(BPlanEnterpriseRequest bPlanEnterprise);
/**
*
* @param bPlanEnterprise
*/
void updatePlan(BPlanEnterpriseRequest bPlanEnterprise);
}

@ -17,7 +17,7 @@ import java.util.Map;
* @author wu
* @since 2023-09-07 09:43:06
*/
public interface BPlanEnterpriseService extends IService<BPlanEnterpriseRequest> {
public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
@ -107,5 +107,11 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterpriseRequest>
* @param bPlanEnterprise
*/
void insert(BPlanEnterpriseRequest bPlanEnterprise);
/**
*
* @param bPlanEnterprise
*/
void updatePlan(BPlanEnterpriseRequest bPlanEnterprise);
}

@ -23,7 +23,7 @@ import java.util.Map;
* @since 2023-09-07 09:43:07
*/
@Service("bPlanEnterpriseService")
public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMapper, BPlanEnterpriseRequest> implements BPlanEnterpriseService {
public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMapper, BPlanEnterprise> implements BPlanEnterpriseService {
@Resource
private BPlanEnterpriseMapper bPlanEnterpriseMapper;
@ -111,6 +111,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
bPlanEnterpriseMapper.insertPlan(bPlanEnterprise);
}
@Override
public void updatePlan(BPlanEnterpriseRequest bPlanEnterprise) {
bPlanEnterpriseMapper.updatePlan(bPlanEnterprise);
}
}

@ -326,6 +326,33 @@
</foreach>
</update>
<update id="updatePlan" parameterType="BPlanEnterpriseRequest">
update b_plan_enterprise
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id=#{enterpriseId},</if>
<if test="district != null">district=#{district},</if>
<if test="plannedYear != null">planned_year={plannedYear},</if>
<if test="isPoint != null">is_point=#{isPoint},</if>
<if test="enterpriseName != null">enterprise_name=#{enterpriseName},</if>
<if test="lawSort != null">law_sort=#{law_sort},</if>
<if test="lawAreas != null">law_areas=#{lawAreas},</if>
<if test="lawLevel != null">law_level=#{lawLevel},</if>
<if test="lawHierarchy != null">law_hierarchy=#{lawHierarchy},</if>
<if test="plannedMonth != null">planned_month=#{plannedMonth},</if>
<if test="status != null">status=#{status},</if>
<if test="createId != null">create_id=#{createId},</if>
<if test="createBy != null">create_by=#{createBy},</if>
<if test="createTime != null">create_time=#{createTime},</if>
<if test="updateId != null">update_id=#{updateId},</if>
<if test="updateBy != null">update_by=#{updateBy},</if>
<if test="updateTime != null">update_time=#{updateTime},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="userId != null">user_id=#{userId},</if>
<if test="deptId != null">dept_id=#{deptId},</if>
</trim>
where id = #{id}
</update>
<insert id="insertPlan" parameterType="BPlanEnterpriseRequest" useGeneratedKeys="true" keyProperty="id">

Loading…
Cancel
Save