嘉義梅山公園

嘉義蘭潭水庫




金瓜石

朱銘美術館

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; } |