Prechádzať zdrojové kódy

修改账单控制器

qmj 1 týždeň pred
rodič
commit
d82b3e52ef

+ 9 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBillingMapper.java

@@ -38,7 +38,15 @@ public interface UserBillingMapper  extends BaseMapper<UserBilling>
 
     //统计商户已提现
     @Select("SELECT IFNULL(SUM(amount),0) FROM user_billing WHERE user_id=#{shid} and type=2 and state=0")  //查询语句
-    int getshtxsum(@Param("shid") Long shid);  //反回结果
+    int getshtxsum(@Param("shid") Long shid);
+
+    //统计商户全部收入(qb)
+    @Select("SELECT IFNULL(SUM(amount),0) FROM user_billing WHERE user_id=#{shid} and type=0 and state=0")
+    int getshqbsum(@Param("shid") Long shid);
+
+    //统计商户当天收入(dt)
+    @Select("SELECT IFNULL(SUM(amount),0) FROM user_billing WHERE user_id=#{shid} and type=0 and state=0 and DATE_FORMAT(cretim, '%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')")
+    int getshdtsum(@Param("shid") Long shid);  //反回结果
 
     //商家月账单统计
     @Select("SELECT IFNULL(COUNT(1),0) AS sul,IFNULL(SUM(amount),0) AS shouru ,IFNULL(SUM(divvy),0) AS commission,IFNULL(SUM(tax),0) AS tax,IFNULL(SUM(behalf_amount),0) AS behalfAmount FROM user_billing WHERE type=0 and user_id=#{shid} and DATE_FORMAT(cretim, '%Y-%m') = #{riqi} and state=0")  //查询语句

+ 2 - 0
ruoyi-system/target/classes/mapper/Billing/UserBillingMapper.xml

@@ -46,6 +46,8 @@
             <if test="balancePay != null  and balancePay != ''"> and b.balance_pay = #{balancePay}</if>
             <if test="userName != null and userName != ''"> and (u.user_name like concat('%', #{userName}, '%') or u.phone like concat('%', #{userName}, '%'))</if>
             <if test="userType != null and userType != ''"> and u.user_type = #{userType}</if>
+            <if test="cretimStart != null and cretimStart != ''"> and b.cretim &gt;= #{cretimStart}</if>
+            <if test="cretimEnd != null and cretimEnd != ''"> and b.cretim &lt;= #{cretimEnd}</if>
         </where>
         order by id desc
     </select>