批量更新状态

zhangtao
dongdingding 1 year ago
parent a01fb1b3f0
commit d4344978c3

@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.List;
/**
@ -198,9 +199,10 @@ public class BPlanEnterpriseController extends BaseController {
/**
*
*/
@ApiOperation(value = "查看计划明细")
@PostMapping("/updateIdList")
public AjaxResult updateIdList(String[] idList) {
@ApiOperation(value = "批量更新状态")
@GetMapping("/updateIdList")
public AjaxResult updateIdList(@RequestParam("idListStr") String idListStr) {
List<String> idList = Arrays.asList(idListStr.split(","));
bPlanEnterpriseService.updateIdList(idList);
return AjaxResult.success();
}

@ -104,7 +104,7 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
*
* @param idList
*/
void updateIdList(String[] idList);
void updateIdList(List<String> idList);
/**

@ -99,7 +99,7 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
*
* @param idList
*/
void updateIdList(String[] idList);
void updateIdList(List<String> idList);
/**

@ -102,7 +102,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
}
@Override
public void updateIdList(String[] idList) {
public void updateIdList(List<String> idList) {
bPlanEnterpriseMapper.updateIdList(idList);
}

@ -317,15 +317,15 @@
</select>
<update id="updateIdList">
<update id="updateIdList" parameterType="java.util.List">
UPDATE b_plan_enterprise
SET status = 1
WHERE id in
<foreach item="item" collection="idList" open="(" separator="," close=")">
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="updatePlan" parameterType="BPlanEnterpriseRequest">
update b_plan_enterprise
<trim prefix="SET" suffixOverrides=",">

Loading…
Cancel
Save