Commit e7a3550b authored by 盖献康's avatar 盖献康

车企信息 - 删除多余代码

parent ddb109c4
......@@ -48,19 +48,4 @@ public interface AutomobileEnterpriseMapper extends BaseMapper<AutomobileEnterpr
*/
public int updateAutomobileEnterprise(AutomobileEnterprise automobileEnterprise);
/**
* 删除车企信息
*
* @param id 车企信息主键
* @return 结果
*/
public int deleteAutomobileEnterpriseById(Long id);
/**
* 批量删除车企信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAutomobileEnterpriseByIds(Long[] ids);
}
......@@ -7,6 +7,9 @@ import com.ruoyi.domain.AutomobileEnterprise;
import com.ruoyi.web.request.AutomobileEnterpriseListRequest;
/**
* @author gxk
*/
public interface AutomobileEnterpriseService extends IService<AutomobileEnterprise>
{
/**
......@@ -20,7 +23,7 @@ public interface AutomobileEnterpriseService extends IService<AutomobileEnterpri
/**
* 查询车企信息列表
*
* @param automobileEnterprise 车企信息
* @param request 车企信息
* @return 车企信息集合
*/
public List<AutomobileEnterprise> selectAutomobileEnterpriseList(AutomobileEnterpriseListRequest request);
......@@ -41,19 +44,4 @@ public interface AutomobileEnterpriseService extends IService<AutomobileEnterpri
*/
public int updateAutomobileEnterprise(AutomobileEnterprise automobileEnterprise);
/**
* 批量删除车企信息
*
* @param ids 需要删除的车企信息主键集合
* @return 结果
*/
public int deleteAutomobileEnterpriseByIds(Long[] ids);
/**
* 删除车企信息信息
*
* @param id 车企信息主键
* @return 结果
*/
public int deleteAutomobileEnterpriseById(Long id);
}
package com.ruoyi.service.impl;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -42,7 +41,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
/**
* 查询车企信息列表
*
* @param automobileEnterprise 车企信息
* @param request 车企信息
* @return 车企信息
*/
@Override
......@@ -62,7 +61,6 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
{
automobileEnterprise.setCreateTime(DateUtils.getNowDate());
automobileEnterprise.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
automobileEnterprise.setDeleted(0);
return automobileEnterpriseMapper.insert(automobileEnterprise);
}
......@@ -80,33 +78,4 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
return automobileEnterpriseMapper.updateAutomobileEnterprise(automobileEnterprise);
}
/**
* 批量删除车企信息
*
* @param ids 需要删除的车企信息主键
* @return 结果
*/
@Override
public int deleteAutomobileEnterpriseByIds(Long[] ids)
{
Arrays.stream(ids).forEach(id -> {
lambdaUpdate()
.eq(AutomobileEnterprise::getId, id)
.set(AutomobileEnterprise::getDeleted, 1)
.update();
});
return 1;
}
/**
* 删除车企信息信息
*
* @param id 车企信息主键
* @return 结果
*/
@Override
public int deleteAutomobileEnterpriseById(Long id)
{
return automobileEnterpriseMapper.deleteAutomobileEnterpriseById(id);
}
}
package com.ruoyi.web;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
......@@ -101,8 +102,8 @@ public class AutomobileEnterpriseController extends BaseController
@ApiOperation("删除车企信息")
@Log(title = "车企信息", businessType = BusinessType.DELETE)
@PostMapping("/remove")
public R<Integer> remove(@Validated @RequestBody AutomobileEnterpriseEditRequest request)
public R<Boolean> remove(@Validated @RequestBody AutomobileEnterpriseEditRequest request)
{
return R.ok(automobileEnterpriseService.deleteAutomobileEnterpriseByIds(request.getIds()));
return R.ok(automobileEnterpriseService.removeBatchByIds(Arrays.asList(request.getIds())));
}
}
......@@ -98,17 +98,4 @@
</trim>
where id = #{id}
</update>
<delete id="deleteAutomobileEnterpriseById" parameterType="Long">
delete
from t_automobile_enterprise
where id = #{id}
</delete>
<delete id="deleteAutomobileEnterpriseByIds" parameterType="String">
delete from t_automobile_enterprise where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment