初始值維護sql範例

2022-09-12 15:15:30 字數 1405 閱讀 5830

-- 收支明細(訂單型別)

set a.order_type = b.order_type

where a.order_type is null;

-- 收支明細(應用名稱)

-- 收支明細(收支物件 開通)

set a.obj_name = if(length(b.buyer_name)>0, b.buyer_name, b.buyer_username)

where a.settle_type = 0 and a.obj_name is null;

-- 收支明細(收支物件 開發者結算)

update tb_cloud_income_expenditure a left join tb_cloud_order_settle b on a.order_id = b.order_id

left join sys_user c on b.user_id = c.id

left join tb_company_authentication_info d on c.authentication_sn = d.authentication_sn

set a.obj_name = d.company_name

where a.settle_type = 10 and a.obj_name is null;

-- 收支明細(收支物件 渠道商結算)

update tb_cloud_income_expenditure a left join tb_cloud_order_settle b on a.order_id = b.order_id

left join tb_cloud_channel c on b.user_id = c.user_id

set a.obj_name = c.`name`

where a.settle_type = 20 and a.obj_name is null;

-- 收支明細(收支物件 手續費)

update tb_cloud_income_expenditure a left join tb_cloud_order_settle b on a.order_id = b.order_id

left join tb_cloud_channel c on b.user_id = c.user_id

set a.obj_name = '易寶'

where a.settle_type in (30,40) and a.obj_name is null;

-- 新增欄位後初始化

update tb_user_login_record a left join sys_user b on a.user_sn = b.usersn set a.phone = b.phone;

-- 初始化中臺關係表過期時間

-- 初始化應用關係表過期時間

DateTime 賦初始值

今天在將資料庫裡的datetime型別資料賦給c 裡datetime型別變數的時候遇到乙個問題,那就是資料庫裡面的datetime資料存在null值。c 預設不能將null賦給datetime變數,但是可以使用nullable型別的datetime,只需在宣告變數的時候在datetime後加乙個?號...

討論 C Calendar賦初始值

q 我在page load的時候給calendar賦初始值,但是page顯示之後,calendar顯示是當天 比如今天顯示7月12號 我想讓它預設顯示出我給賦的時間 8 30 2006 我該怎麼去設定呢?a calendar1.selecteddate new datetime datetime.n...

傳參初始值問題

方式一 後台直接接收,列出所有引數,設定預設值為空,這樣mybatis判斷時不會出現找不到引數屬性的情況 requestbody為接收json或者實體物件必備 requestparam value endtime defaultvalue string endtime,requestparam va...