| | |
| | | */ |
| | | public String saveMaterialType(FieldSetEntity fse) { |
| | | if (BaseUtil.strIsNull(fse.getUUID())) { |
| | | FieldSetEntity fseMaxValue = baseDao.getFieldSetEntityBySQL("SELECT (MAX(material_type_value) + 1) material_type_value FROM product_project_base_material_type", new Object[] {}, false); |
| | | FieldSetEntity fseMaxValue = baseDao.getFieldSetEntityBySQL("SELECT IFNULL((MAX(material_type_value) + 1),0) material_type_value FROM product_project_base_material_type", new Object[] {}, false); |
| | | fse.setValue(CmnConst.MATERIAL_TYPE_VALUE, fseMaxValue.getString(CmnConst.MATERIAL_TYPE_VALUE)); |
| | | } else { |
| | | if ("0".equals(fse.getString(CmnConst.IS_USED))) { |
| | |
| | | } |
| | | baseDao.saveFieldSetEntity(fse); |
| | | return fse.getUUID(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页获取材料信息 |
| | |
| | | if (BaseUtil.strIsNull(fse.getString(CmnConst.MATERIAL_TYPE)) || fse.getInteger(CmnConst.MATERIAL_TYPE)==-1) { |
| | | dt = baseDao.listTable(CmnConst.PRODUCT_PROJECT_BASE_MATERIAL, null, null, null, null, fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE)); |
| | | }else { |
| | | dt = baseDao.listTable(CmnConst.PRODUCT_PROJECT_BASE_MATERIAL, "material_type like ?", new Object[] {"%"+fse.getInteger(CmnConst.MATERIAL_TYPE)+"%"}, null, null, fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE)); |
| | | dt = baseDao.listTable(CmnConst.PRODUCT_PROJECT_BASE_MATERIAL, "CONCAT(',',material_type,',') like ?", new Object[] {"%,"+fse.getInteger(CmnConst.MATERIAL_TYPE)+",%"}, null, null, fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE)); |
| | | } |
| | | |
| | | baseDao.loadPromptData(dt); |