这个删除是用tGlAccvouch.setStatus("04")使数据库中对应要删除的Status值为04,然后怎么写代码将这些为04值对应的记录删掉啊,请高手指教~//删除
    @RequestMapping(value = "/delAccvouch", method = { RequestMethod.GET, RequestMethod.POST })
    @ResponseBody
    public Map<String, String> delAccvouch(HttpServletRequest request, HttpServletResponse response) {
       
        String delIds = request.getParameter("delIds");
        String[] ids = delIds.split(",");
        for (int i = 0; i < ids.length; i++) {
            if (ids[i] != null && !"".equals(ids[i].trim())) {
                
                TGlAccvouch tGlAccvouch =accvouchManager.getTGlAccvouch(ids[i]);
                tGlAccvouch.setStatus("04");
                tGlAccvouch.setUpdateDate(new Date());
                
                accvouchManager.saveOrUpdateTGlAccvouch(tGlAccvouch);
            }
        }
        
        Map<String, String> map = new HashMap<String, String>();
        
        map.put("message", "成功");
        
        return map;
    }    

解决方案 »

  1.   

    你这是逻辑删除?  查询的时候带上条件 where Status <> 04物理删除的时候 只删除 where Status = 04
      

  2.   

    我是想不显示status=04的数据库的数据来实现所谓的删除
      

  3.   

    业务不是很清楚了么  前台执行删除功能就是update  table  set state = '04' where id=:id 查询时 from table where id!='04'
    至于真的要删除时
    delete table where state ='04'
      

  4.   

    给表加一列,“已删除”,置01两个值,0是没删,1是删了,把删除替换为update表的操作
      

  5.   

    只要让用户看不到这些数据就可以让他理解成“已删除了”
    查询的时候给sql加上条件status不等于04就可以了
      

  6.   

    顶楼上,int no,假如04是No属性,在select里面加上||No!=no