添加删除方法deleteByCompileIds,传入前台传入的compileIds串,批量删除区域IP时调用此方法
This commit is contained in:
@@ -29,4 +29,5 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
|
||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||
public int getIsAudit(BaseIpCfg entity);
|
||||
public int deleteByCompileId(BaseIpCfg entity);
|
||||
public int deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds);
|
||||
}
|
||||
|
||||
@@ -543,4 +543,7 @@
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.BaseIpCfg" >
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="deleteByCompileIds" parameterType="com.nis.domain.configuration.BaseIpCfg" >
|
||||
update ${tableName} set is_valid = -1, editor_id = #{user,jdbcType=INTEGER} , edit_time = NOW() where compile_id in (${compileIds})
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -334,17 +334,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
if(StringUtils.isNotBlank(compileIds)){
|
||||
for(String compileId:compileIds.split(",")){//强转数字,防止注入
|
||||
Integer.parseInt(compileId);
|
||||
// AreaIpCfg area=new AreaIpCfg();
|
||||
// area.setCompileId(Integer.parseInt(compileId));
|
||||
// area.setFunctionId(functionId);
|
||||
// area.setIsValid(Constants.VALID_DEL);
|
||||
// areaIpCfgDao.updateValid(area);
|
||||
}
|
||||
BaseIpCfg area=new BaseIpCfg();
|
||||
area.setTableName(AreaIpCfg.getTablename());
|
||||
area.setCompileId(Integer.parseInt(compileIds));
|
||||
area.setIsValid(Constants.VALID_DEL);
|
||||
ipCfgDao.deleteByCompileId(area);
|
||||
ipCfgDao.deleteByCompileIds(new BaseIpCfg().getCurrentUser().getId(),AreaIpCfg.getTablename(),compileIds);
|
||||
}
|
||||
List<BaseIpCfg> ipCfgs=new ArrayList<BaseIpCfg>();
|
||||
Date date =new Date();
|
||||
|
||||
Reference in New Issue
Block a user