Commit 62b7d8b9 authored by Quxl's avatar Quxl

x

parent 6d72db50
...@@ -723,9 +723,64 @@ public class UserServiceImpl implements UserService { ...@@ -723,9 +723,64 @@ public class UserServiceImpl implements UserService {
jdbcTemplate.update("update tCustomer set sOpenID = ? where sCustNO = ?", openId, sCustNO); jdbcTemplate.update("update tCustomer set sOpenID = ? where sCustNO = ?", openId, sCustNO);
} }
public static void main(String[] args) {
String sql = ""
+ "select "
+ "top 1 "
+ "s.sShopNO, "
+ "sm.sSalesmanNO, "
+ "sm.sSalesmanName, "
+ "sm.sOrgNO, "
+ "sm.sSalesmanTypeID, "
+ "sm.sMobile, "
+ "sm.sEmail, "
+ "sm.nAgentID, "
+ "sm.nTag, "
+ "sm.dLastUpdateTime, "
+ "sm.dCreateDate, "
+ "sm.sOpenID, "
+ "sm.sBindOpenID, "
+ "case when sm.sBankTypeID is not null then sm.sBankTypeID else o.sBankTypeID end sBankTypeID, "
+ "case when sm.sBankType is not null then sm.sBankType else o.sBankType end sBankType, "
+ "case when sm.sBankAccountNO is not null then sm.sBankAccountNO else o.sBankAccountNO end sBankAccountNO, "
+ "case when sm.sBankAccount is not null then sm.sBankAccount else o.sBankAccount end sBankAccount "
+ "from "
+ "tSalesman sm, "
+ "tShop s "
+ "left join tOrg o on o.sOrgNO = s.sOrgNO "
+ "where "
+ "sm.sSalesmanNO = s.sSalesmanNO1 and s.sShopNO = ?";
System.out.println(sql);
}
@Override @Override
public Map<String, Object> getSalesmanByShopNo(String shopNo) { public Map<String, Object> getSalesmanByShopNo(String shopNo) {
String sql = "select top 1 sm.* from tSalesman sm, tShop s where sm.sSalesmanNO = s.sSalesmanNO1 and s.sShopNO = ?"; String sql = ""
+ "select "
+ "top 1 "
+ "s.sShopNO, "
+ "sm.sSalesmanNO, "
+ "sm.sSalesmanName, "
+ "sm.sOrgNO, "
+ "sm.sSalesmanTypeID, "
+ "sm.sMobile, "
+ "sm.sEmail, "
+ "sm.nAgentID, "
+ "sm.nTag, "
+ "sm.dLastUpdateTime, "
+ "sm.dCreateDate, "
+ "sm.sOpenID, "
+ "sm.sBindOpenID, "
+ "case when sm.sBankTypeID is not null then sm.sBankTypeID else o.sBankTypeID end sBankTypeID, "
+ "case when sm.sBankType is not null then sm.sBankType else o.sBankType end sBankType, "
+ "case when sm.sBankAccountNO is not null then sm.sBankAccountNO else o.sBankAccountNO end sBankAccountNO, "
+ "case when sm.sBankAccount is not null then sm.sBankAccount else o.sBankAccount end sBankAccount "
+ "from "
+ "tSalesman sm, "
+ "tShop s "
+ "left join tOrg o on o.sOrgNO = s.sOrgNO "
+ "where "
+ "sm.sSalesmanNO = s.sSalesmanNO1 and s.sShopNO = ?";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, shopNo); List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, shopNo);
return list != null && list.size() > 0 ? list.get(0) : null; return list != null && list.size() > 0 ? list.get(0) : null;
} }
......
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