多表查询
2020-07-10 15:19 改改~_~ 阅读(209) 评论(0) 编辑 收藏 举报1.从以下json串中提取到的参数
[{"id":"a9e64f7e6fad57a0e053b129fd0a917b","createUser":null,"createTime":null,"updateUser":null,"updateTime":null,"version":null,"delTag":null,"payPart":"plat_back","recPart":"plat_fee","rateWay":"rate_fixedRate","payTime":"20","status":"1","yearDays":360,"feeId":"5D63C804E61240sss0530346A8C0CFG","productId":"a9e64f7e6f9357a0e053b129fd0a917b","productFeeRateWays":[{"id":"a9e64f7e6fae57a0e053b129fd0a917b","createUser":null,"createTime":null,"updateUser":null,"updateTime":null,"version":null,"delTag":null,"rateWay":null,"column1":null,"column2":null,"column3":null,"minMoney":null,"maxMoney":null,"defaultMoney":null,"minDay":null,"defaultDay":null,"maxDay":null,"minRate":"0.1","maxRate":"0.3","defaultRate":"0.1","productFeeId":"a9e64f7e6fad57a0e053b129fd0a917b"}],"column1":null,"column2":null,"column3":null,"feeName":"==借款服务费,还款时点","formulaName":"实际募集金额*固定费率*借款天数/360","formula":"${rate_factor_realCapitalNoPlan}*${rate_fixedRate}*${rate_fixedTerm}/100/360","index":null,"defalutMoney":null,"feeType":"1","recPartName":"==费用账户"},{"id":"a9e64f7e6fad57a0e053b129fd0a917b","createUser":null,"createTime":null,"updateUser":null,"updateTime":null,"version":null,"delTag":null,"payPart":"plat_back","recPart":"plat_fee_sjw","rateWay":"rate_fixedRate","payTime":"20","status":"1","yearDays":360,"feeId":"5D63C804E61239sss0530346A8C0CFH","productId":"a9e64f7e6f9357a0e053b129fd0a917b","productFeeRateWays":[{"id":"a9e64f7e6fb057a0e053b129fd0a917b","createUser":null,"createTime":null,"updateUser":null,"updateTime":null,"version":null,"delTag":null,"rateWay":null,"column1":null,"column2":null,"column3":null,"minMoney":null,"maxMoney":null,"defaultMoney":null,"minDay":null,"defaultDay":null,"maxDay":null,"minRate":"0.1","maxRate":"0.3","defaultRate":"0.2","productFeeId":"a9e64f7e6fad57a0e053b129fd0a917b"}],"column1":null,"column2":null,"column3":null,"feeName":"==借款服务费,还款时点","formulaName":"实际募集金额*固定费率*借款天数/360","formula":"${rate_factor_realCapitalNoPlan}*${rate_fixedRate}*${rate_fixedTerm}/100/360","index":null,"defalutMoney":null,"feeType":"1","recPartName":"==费用账户"}]
2.分析数据关系
3.进行多表查询
-- 添加融资产品成功后,busiProductFeeList抓包接口数据对应关系 SELECT t.id,t.* FROM TD_B_PRODUCT t where PRODUCT_NAME like '%J%' SELECT t.* FROM TD_B_FEE_SETTING t where id like '%5D63C804E61240sss0530346A8C0CFG%'; SELECT t.* FROM TD_B_FEE_SETTING t where id like '%5D63C804E61239sss0530346A8C0CFH%'; SELECT t.* FROM TD_B_PRODUCT_FEE_RATE_WAY t where id like '%a9e64f7e6faf57a0e053b129fd0a917b%'; SELECT t.* FROM TD_B_PRODUCT_FEE_RATE_WAY t where PRODUCT_FEE_ID like '%a9e64f7e6fad57a0e053b129fd0a917b%'; SELECT t.* FROM TD_B_PRODUCT_FEE t where id like '%a9e64f7e6fad57a0e053b129fd0a917b%' SELECT t.* FROM TD_B_PRODUCT_FEE t where PRODUCT_ID like '%a9e64f7e6f9357a0e053b129fd0a917b%' SELECT t.* FROM TD_B_PRODUCT_FEE t where PRODUCT_ID LIKE '%a9e64f7e6f9357a0e053b129fd0a917b%' SELECT t.* FROM TD_B_PRODUCT_FEE t where FEE_ID like '%5D63C804E61240sss0530346A8C0CFG%' and PRODUCT_ID LIKE '%a9e64f7e6f9357a0e053b129fd0a917b%' SELECT t.* FROM TD_B_PRODUCT_FEE t where FEE_ID like '%5D63C804E61239sss0530346A8C0CFH%' --productFeeId-多表查询结果 SELECT t3.PRODUCT_NAME,t1.id idproductFeeId,t1.FEE_ID feeId,t1.PRODUCT_ID productId,t4.id id2 FROM TD_B_PRODUCT_FEE t1 JOIN TD_B_PRODUCT t3 ON t1.PRODUCT_ID=t3.ID JOIN TD_B_PRODUCT_FEE_RATE_WAY t4 ON t1.id=t4.PRODUCT_FEE_ID WHERE t3.PRODUCT_NAME like '%J月月盈_T0%';
--或者 SELECT t3.PRODUCT_NAME, t.id,t.FEE_ID,t.PRODUCT_ID,t4.ID,t.REC_PART FROM (TD_B_PRODUCT_FEE t LEFT JOIN TD_B_PRODUCT_FEE_RATE_WAY t4 ON t.id=t4.PRODUCT_FEE_ID) LEFT JOIN TD_B_PRODUCT t3 ON t3.ID=t.PRODUCT_ID where t3.PRODUCT_NAME LIKE '%月月盈_T0%'