Commit 9371178b authored by Quxl's avatar Quxl

x

parent 809e5220
......@@ -764,6 +764,7 @@ public class UserServiceImpl implements UserService {
@Override
public Map<String, Object> getSalesmanByShopNo(String shopNo) {
String caseWhen = "(sm.sBankTypeID is not null and sm.sBankTypeID != '' and sm.sBankAccount is not null and sm.sBankAccount != '' and sm.sBankAccountNO is not null and sm.sBankAccountNO != '')";
String sql = ""
+ "select "
+ "top 1 "
......@@ -781,10 +782,10 @@ public class UserServiceImpl implements UserService {
+ "sm.sOpenID, "
+ "sm.sBindOpenID, "
+ "sm.sPlugid, "
+ "case when (sm.sBankTypeID is not null and sm.sBankTypeID != '' and sm.sBankAccount is not null and sm.sBankAccount != '' and sm.sBankAccountNO is not null and sm.sBankAccountNO != '') then sm.sBankTypeID else o.sBankTypeID end sBankTypeID, "
+ "case when (sm.sBankTypeID is not null and sm.sBankTypeID != '' and sm.sBankAccount is not null and sm.sBankAccount != '' and sm.sBankAccountNO is not null and sm.sBankAccountNO != '') then sm.sBankType else o.sBankType end sBankType, "
+ "case when (sm.sBankTypeID is not null and sm.sBankTypeID != '' and sm.sBankAccount is not null and sm.sBankAccount != '' and sm.sBankAccountNO is not null and sm.sBankAccountNO != '') then sm.sBankAccountNO else o.sBankAccountNO end sBankAccountNO, "
+ "case when (sm.sBankTypeID is not null and sm.sBankTypeID != '' and sm.sBankAccount is not null and sm.sBankAccount != '' and sm.sBankAccountNO is not null and sm.sBankAccountNO != '') then sm.sBankAccount else o.sBankAccount end sBankAccount "
+ "case when " + caseWhen + " then sm.sBankTypeID else o.sBankTypeID end sBankTypeID, "
+ "case when " + caseWhen + " then sm.sBankType else o.sBankType end sBankType, "
+ "case when " + caseWhen + " then sm.sBankAccountNO else o.sBankAccountNO end sBankAccountNO, "
+ "case when " + caseWhen + " then sm.sBankAccount else o.sBankAccount end sBankAccount "
+ "from "
+ "tSalesman sm, "
+ "tShop s "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment