批量更新状态

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

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

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

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

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

Loading…
Cancel
Save