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;
        }
  • 相关阅读:
    JavaStript基础 —— JavaStript语法
    JS拖动滑块验证
    解释型语言和编译型语言、弱类型语言和强类型语言、动态语言和静态语言的区别
    user-select 用户禁止选中
    短地址
    JS实现 Tab栏切换案例
    setAttribute()方法和 getAttribute() 方法
    JS 全局作用域和局部作用域
    数组遍历 forEach 方法
    十进制小数转换为二进制
  • 原文地址:https://www.cnblogs.com/xueblvip/p/14928024.html
Copyright © 2011-2022 走看看