zoukankan      html  css  js  c++  java
  • 文本框上绑校验

    加属性 
    ajaxurl="ldcInvtHeadController.do?checkType&id=${ldcInvtHeadPage.id }&type=S"  datatype="*"
    @RequestMapping(params = "checkType")
        @ResponseBody
        public ValidForm checkType(HttpServletRequest request) {
            ValidForm v = new ValidForm();
            String typecode=oConvertUtils.getString(request.getParameter("param"));
            String id=oConvertUtils.getString(request.getParameter("id"));
            String ietype=oConvertUtils.getString(request.getParameter("type"));
            String hql = "select count(*) from LDC_INVT_HEAD where   (BILLFLAG!='2' or  BILLFLAG is NULL) and (CUSTOM_STATE!='6' or  CUSTOM_STATE is NULL) ";
    
    
            if(ietype.equals("I")) {
                hql=hql+"  and ORDERBOOKBILLNO='"+typecode+"'  ";
            }
            if(ietype.equals("E")) {
                hql=hql+"  and INVOICE='"+typecode+"'  ";
            }
            if(ietype.equals("P")) {
                hql=hql+"  and BOND_INVT_NO='"+typecode+"'  ";
            }
            if(ietype.equals("S")) {
                hql=hql+"  and ETPS_INNER_INVT_NO='"+typecode+"'  ";
            }
            if(StringUtil.isNotEmpty(id)) {
                hql=hql+"  and id!='"+id+"'";
            }
    
    
            String types = jdbcTemplate.queryForObject(hql, String.class);
            if(!types.equals("0"))
            {
                v.setInfo("类型已存在");
                v.setStatus("n");
            }
            return v;
        }
    @RequestMapping(params = "checkType")
        @ResponseBody
        public ValidForm checkType(HttpServletRequest request) {
            ValidForm v = new ValidForm();
            String typecode=oConvertUtils.getString(request.getParameter("param"));
            String id=oConvertUtils.getString(request.getParameter("id"));
            String ietype=oConvertUtils.getString(request.getParameter("type"));
            String hql = "select count(*) from LDC_INVT_HEAD where   (BILLFLAG!='2' or  BILLFLAG is NULL) and (CUSTOM_STATE!='6' or  CUSTOM_STATE is NULL) ";
    
    
            if(ietype.equals("I")) {
                hql=hql+"  and ORDERBOOKBILLNO='"+typecode+"'  ";
            }
            if(ietype.equals("E")) {
                hql=hql+"  and INVOICE='"+typecode+"'  ";
            }
            if(ietype.equals("P")) {
                hql=hql+"  and BOND_INVT_NO='"+typecode+"'  ";
            }
            if(ietype.equals("S")) {
                hql=hql+"  and ETPS_INNER_INVT_NO='"+typecode+"'  ";
            }
            if(StringUtil.isNotEmpty(id)) {
                hql=hql+"  and id!='"+id+"'";
            }
    
    
            String types = jdbcTemplate.queryForObject(hql, String.class);
            if(!types.equals("0"))
            {
                v.setInfo("类型已存在");
                v.setStatus("n");
            }
            return v;
        }
  • 相关阅读:
    dblink && 视图 数据库二合一
    oracle mybatis 逆向工程 应当注意的问题
    关于使用vue搭建前后端分离的项目,部署过程遇到的问题
    详解vue静态资源打包中的坑与解决方案
    bootstarap table 分页导出 vue版
    react中两个控件不是父子关系该怎么传递消息或任意控件怎么传递消息
    虚拟DOM中key的作用
    修改Antd的List列表的单个数据行
    移动端开发如何关闭手机键盘
    在一行显示两个数据,左边的数据右对齐,右边的数据左对齐
  • 原文地址:https://www.cnblogs.com/xueblvip/p/14928024.html
Copyright © 2011-2022 走看看