2019 7 10小知識點

2021-09-25 04:01:18 字數 1716 閱讀 1987

今天做專案,偶遇基礎知識,稍微記錄一下方便自己以後檢視。

1:mpper.xml中parametertype和resulttype

(1)使用 resulttype : 主要針對於從資料庫中提取相應的資料出來,比如seclect查詢語句等

(2)使用parametertype : 主要針對於將資訊存入到資料庫中。如:insert 、update等

2:oracle中日期格式和字串格式的相互轉換

select

to_char(dateid,'yyyy-mm-dd') as datadate,

ordercnt as ordercount,

reccnt as reccount,

dispcnt as dispcount,

signcnt as signcount

from

z_bu_base_forecast2

where

dateid = to_date(#,'yyyymmdd') and datatype = 'all'

(1)to_char(dateid,『yyyy-mm-dd』) as datadate意思是說把日期格式的時間轉換成字串格式,datadate是forecastdto實體類中的乙個屬性,是string型別;

(2)as前面的是資料庫字段,後面的是對應實體類中的屬性

(3)dateid = to_date(#,『yyyymmdd』) and datatype = 'all』是說明指定的表

補充:

(1)selectto_char(sysdate,『yyyy-mm-dd hh24:mi:ss』) as nowtime from dual; //日期轉化為字串

selectto_char(sysdate,『yyyy』) as nowyear from dual; //獲取時間的年

selectto_char(sysdate,『mm』) as nowmonth from dual; //獲取時間的月

selectto_char(sysdate,『dd』) as nowday from dual; //獲取時間的日

selectto_char(sysdate,『hh24』) as nowhour from dual; //獲取時間的時

selectto_char(sysdate,『mi』) as nowminute from dual; //獲取時間的分

selectto_char(sysdate,『ss』) as nowsecond from dual; //獲取時間的秒

select to_date(『2004-05-07 13:23:44』,『yyyy-mm-dd hh24:mi:ss』) from dual

3:@scheduled註解、@datacache

(1)@scheduled(cron = 「$」)表示的是定時器

(2)@datacache表示快取。兩個同時用表示給快取設定定時

Hibernate 小知識點

今天比較忙沒怎麼寫 知識一些曉得知識或是經驗吧!1.lazy延遲載入 也可以說是需要的時候再區載入 場景 乙個類如person和address,person可以通過getaddress 來得到address的set集合.有乙個dao控制類operation.方法public person query...

dom 小知識點

1 classname屬性可設定或返回元素的 class 屬性。function getclass document.getelementbyid d1 classname bbb alert document.getelementbyid d1 classname 2 removechild 刪除...

小知識點 備查

1,kermit c 安裝 sudo apt get install ckermit 開啟串列埠 在終端裡執行 sudo kermit c 命令 關閉串列埠 先同時按住 ctrl 和 鍵,然後鬆開再按 c 鍵,最後輸入 exit 或者q鍵 並回車 2,g sensor android加速度感測器型別...