加属性 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; }