嘉義梅山公園

嘉義蘭潭水庫




金瓜石

朱銘美術館

GRANT privilege-type ON [TABLE] { table-Name | view-Name } TO grantees
CREATE [PUBLIC] SYNONYM [schema .] synonym FOR [schema .] object [@ dblink];
SELECT to_char(sysdate, 'YYYYMMDD') today, to_char(LAST_DAY(sysdate), 'YYYYMMDD') last_day_of_month FROM dual
INSERT INTO dbm031fa(sta_date, age, fund_id, fund_name, age_type, remark, user_id, update_date) SELECT DATEADD(YEAR, 1, sta_date) sta_date, age, fund_id, fund_name, age_type, remark, user_id, CURRENT_TIMESTAMP update_date FROM dbm031fa WHERE year(sta_date) = year(CURRENT_TIMESTAMP)-2
SELECT sta_date FROM dbm031fa WHERE year(sta_date) = year(CURRENT_TIMESTAMP)-2If I would like to get the value of sta_date is the value in database subtract one year, how to do it?
SELECT sta_date, DATEADD(YEAR, -1, sta_date) FROM dbm031fa WHERE year(sta_date) = year(CURRENT_TIMESTAMP)-2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | @RequestMapping(value = "/getAgeTypeList", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public List<Dbm002fbVo> getAgeTypeList( @RequestBody(required = true) final Dbm038eFormBean formBean, Alerter alerter) { List<Dbm002fbVo> result = new ArrayList<Dbm002fbVo>(); List<Dbm002fb> dbm002fbs = dbm038eService.findDropdownList("AGTPE"); if (dbm002fbs != null && dbm002fbs.size() > 0) { for (Dbm002fb dbm002fb : dbm002fbs) { Dbm002fbVo vo = new Dbm002fbVo(); convertToDbm002fbVo(dbm002fb, vo); result.add(vo); } } else { throw new RuntimeException("查無 基金法人類別 下拉單 (kind_code='AGTPE'"); } return result; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | @RequestMapping(value = "/getAgeTypeList", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public List<Dbm002fbVo> getAgeTypeList( @RequestBody(required = true) final Dbm038eFormBean formBean, Alerter alerter) { List<Dbm002fbVo> result = new ArrayList<Dbm002fbVo>(); List<Dbm002fb> dbm002fbs = dbm038eService.findDropdownList("AGTPE"); List<Dbm002fb> newDbm002fbs = excludeCodeNoIsZero(dbm002fbs); if (newDbm002fbs != null && newDbm002fbs.size() > 0) { for (Dbm002fb dbm002fb : newDbm002fbs) { Dbm002fbVo vo = new Dbm002fbVo(); convertToDbm002fbVo(dbm002fb, vo); result.add(vo); } } else { throw new RuntimeException("查無 基金法人類別 下拉單 (kind_code='AGTPE'"); } return result; } private List<Dbm002fb> excludeCodeNoIsZero(List<Dbm002fb> dbm002fbs) { /** * The BeanPropertyValueEqualsPredicate constructor takes two parameters which determine * what property will be evaluated on the target object and what its expected value should * be. */ BeanPropertyValueEqualsPredicate codeNoPredicate = new BeanPropertyValueEqualsPredicate( "codeNo", BigInteger.ZERO); /** * Create a new Predicate that returns true if none of the specified predicates are true. If * the array of predicates is empty, then this predicate returns true. */ Predicate predicate = PredicateUtils.nonePredicate(new Predicate[] { codeNoPredicate }); /** * Selects all elements from input collection which match the given predicate into an output * collection. */ @SuppressWarnings("unchecked") List<Dbm002fb> newDbm002fbs = (List<Dbm002fb>) CollectionUtils.select(dbm002fbs, predicate); return newDbm002fbs; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | $scope.itemGridCols = [ { field : 'accountYr', displayName : '年度', cellClass: 'text-left', width: '150px' }, { field : 'orgType', displayName : 'orgType', cellClass: 'text-left', visible : false }, { field : 'orgTypeName', displayName : '機關類別', cellClass: 'text-left', width: '250px' }, { field : 'masterAge', displayName : 'masterAge', cellClass: 'text-left', visible : false }, { field : 'masterAgeName', displayName : '主管機關名稱', cellClass: 'text-left', width: '250px' }, { field : 'ageName', displayName : '機關名稱', cellClass: 'text-left', width: '250px' }, { field : 'age', displayName : '機關代號', cellClass: 'text-left', width: '250px' } ]; $scope.itemGrid = { keepLastSelected: false, selectedItems: $scope.selectedItem, multiSelect : false, data : 'itemData', columnDefs : 'itemGridCols', enableColumnResize: true, afterSelectionChange : function(rowItem){ if (rowItem.selected) { $scope.model.accountYr = rowItem.entity.accountYr; $scope.model.orgType = rowItem.entity.orgType; $scope.model.masterAge = rowItem.entity.masterAge; $scope.model.ageNm = rowItem.entity.ageName; $scope.model.age = rowItem.entity.age; }else{ $scope.model = {}; $scope.model.accountYr = getCurrentYear()-1; } } }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | $scope.createBtn = function(){ // 驗證表單 if (!$scope.validate(this.dbm039eForm)) { return; } dbmService.execute("rest/create", $scope.model) .then(function(response) { $scope.itemData = response; cAlerter.info('新增成功'); } ); }; $scope.saveBtn = function(){ dbmService.execute("rest/save", $scope.model) .then(function(response) { $scope.itemData = response; cAlerter.info('修改成功'); } ); }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | $scope.setSelectedRow = function(itemData, selectedItem){ var index = 0; var keepGoing = true; angular.forEach(itemData, function(value, key) { if(keepGoing){ if(value.accountYr == selectedItem.accountYr && value.orgType == selectedItem.orgType && value.age == selectedItem.age){ index = key; keepGoing = false; } } }); // remember to set select row in $timeout, or it will NOT work $timeout(function () { $scope.itemGrid.selectRow(index, true); },1 ); }; $scope.createBtn = function(){ // 驗證表單 if (!$scope.validate(this.dbm039eForm)) { return; } dbmService.execute("rest/create", $scope.model) .then(function(response) { $scope.itemData = response; //set model to selectedItem $scope.selectedItem[0] = $scope.model; //set selected row $scope.setSelectedRow($scope.itemData, $scope.selectedItem[0]); cAlerter.info('新增成功'); } ); }; $scope.saveBtn = function(){ if($scope.selectedItem.length == 0){ cAlerter.fatal('請選擇要修改的資料'); return; } dbmService.execute("rest/save", $scope.model) .then(function(response) { $scope.itemData = response; // set selected row $scope.setSelectedRow($scope.itemData, $scope.selectedItem[0]); cAlerter.info('修改成功'); } ); }; |