實習修煉之第七天

2021-09-24 22:23:02 字數 3205 閱讀 6711

在今天開始了乙個簡單功能的實現,就是實現下面sql語句使得在後台管理端進行使用者的刪除,由於專案原因所以沒有進行物理刪除,而是將相關字段設定成不合理的字串使得達到刪除使用者的效果,要實現的具體sql**如下,並將其操作的相應資料表和操作方法在注釋部分顯示

//對應shardingwechataccountdo類

//deletewechataccountbyopenid方法

update account.wechat_account_openid3 set union_id = 'testdeleteunionid' , open_id = 'testdeleteopenid' where open_id = 'o-pop0xgfoiyjk5bw0poisy4jmgq'

update account.wechat_account_openid5 set union_id = 'testdeleteunionid' , open_id = 'testdeleteopenid' where open_id = 'oc7_twumw_ovzmrz4gjcrvbkpopi'

//對應shardingwechataccountdo類

//deletewechataccountbyunionid方法

update account.wechat_account_unionid0 set union_id = 'testdeleteunionid' , open_id = 'testdeleteopenid' where union_id = 'ov1zfwgjlvvfes_kd_tqwgyws1de'

//對應wechataccountdo類

//deletewechataccountbyuserid方法

update account.account7 set wechat_union_id = 'testdeleteunionid' where user_id = 4750351

//deletewechataccountbyuserid方法

update account.wechat_account_userid7 set union_id = 'testdeleteunionid', open_id = 'testdeleteopenid' where user_id = 4750351

//deletetradebyuserid方法

update account.user_trade_status set weixin_unionid = 'testdeleteunionid' where user_id = 4750351

xml檔案配置資料庫—dao層持久化(有兩種方法:利用insert等函式或者利用注釋直接新增依賴)—facde層面向介面宣告—facde.impl層實現方法----dubbo配置加入提供者方

因為原理基本相同,所以在此後羅列的**只是對於乙個資料表的修改,即語句

update account.wechat_account_unionid0

set union_id = 『testdeleteunionid』 , open_id = 『testdeleteopenid』

where union_id = 『ov1zfwgjlvvfes_kd_tqwgyws1de』

的執行

mybatis.xml檔案

在這裡xml檔案裡主要的配置是

<?xml version="1.0" encoding="utf-8" ?>

id,

通過昨天對此xml檔案的學習,先在xml檔案裡新增如下**

update

union_id = 『testdeleteunionid『,

open_id = 『testdeleteopenid『,

updatetime = now()

where union_id= #

dao層持久化實現

具體的updateallidbyunionid方法實現**是

public int updateallidbyunionid (string unionid)
其中update()方法是自己這邊實現的乙個介面方法,mdssqlsessiontemplate是乙個基於disposablebean , mdssqlsession , initializingbean介面的資料類,其中封裝了資料庫操作函式。mdssqlsessiontemplate部分**如下所示

public class mdssqlsessiontemplate implements disposablebean , mdssqlsession , initializingbean 

facde層介面實現

使用如下介面方法deletewechataccountbyunionid實現上述功能

// 根據unionid刪除使用者

public boolean deletewechataccountbyunionid(syncwechataccountreq request);

facde.impl層實現方法

在facde.impl層下對於deletewechataccountbyunionid的繼承如下所示

@autologger

private boolean isvaliddeletewechataccount(syncwechataccountreq request)catch(accountexception e)

if(response != null)

else return true;

}@override

@autologger

public boolean deletewechataccountbyunionid(syncwechataccountreq request)

else return false;

}

dubbo配置加入提供者方

前面已經介紹過dubbo的配置就不再贅述,可以參照

再學習。

這樣的話,基本上的業務邏輯就完成了。

mybatis.xml中sql語句中對於標籤引用的部分可以參考

實習第七天

昨天經理說今天會刮颱風,所以我們要求停課比較好,畢竟我是乙個非常熱愛生命的人,這絕對不是因為我小時候差點被颱風刮走,真的不是因為這個!可是今天一大早,天氣很涼快,可是再如何涼快,還是沒有暴風雨即將來臨的感覺,為此我們捶胸頓足,為什麼停課,停課也不得不去,因為我們還得以實習生的身份過去,說起這ppt,...

實習第七天

昨天的總結 怎麼說呢?自己大概知道怎麼做,然後因為不太確定,然後也是沒有直接複製而是直接打的,所以回出錯。因此下次的時候要直接複製會比較保險 因為剛開始學,會不太確定,然後又打錯,看到沒有效果就會以為是錯的 1 所以複製貼上是最保險的 2 還有就是空格 3.還有就是大小寫的問題 今日目標 養成習慣 ...

校內實習第七天

request 合法網域名稱 而且在libs檔案引入了兩個天氣的.js檔案用來獲取今天的天氣以及7天的天氣。另外利用元件scroll view對整個頁面進行了上下滾動。scroll y 以及對部分天氣資訊的顯示和利用flex布局對其進行相關布局 wxml部分 24小時逐3小時預報 時間 溫度 天氣 ...