dongke 2 лет назад
Родитель
Сommit
c546286a76

+ 10 - 0
src/main/java/com/dk/mdm/controller/mst/MoneyAccountController.java

@@ -35,6 +35,16 @@ public class MoneyAccountController{
     public ResponseResultVO<PageList<MoneyAccountResponse>> selectByCond(@RequestBody MoneyAccountQuery moneyAccountQuery) {
         return moneyAccountService.selectByCond(moneyAccountQuery);
     }
+    /**
+     * @desc : 维修小程序查询
+     * @author : 王英杰
+     * @date : 2023/2/29 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<MoneyAccountResponse>> wxSelectByCond(@RequestBody MoneyAccountQuery moneyAccountQuery) {
+        return moneyAccountService.wxSelectByCond(moneyAccountQuery);
+    }
 
     /**
      * @desc   : 通过ID查询

+ 13 - 0
src/main/java/com/dk/mdm/mapper/mst/MoneyAccountMapper.java

@@ -20,6 +20,12 @@ public interface MoneyAccountMapper extends BaseMapper<MoneyAccount>{
      * @date   : 2024/3/1 10:42
      */
     List<MoneyAccountResponse> selectByCond(MoneyAccountQuery moneyAccountQuery);
+    /**
+     * @desc   : 维修小程序列表
+     * @author : 王英杰
+     * @date   : 2024/3/1 10:42
+     */
+    List<MoneyAccountResponse> wxSelectByCond(MoneyAccountQuery moneyAccountQuery);
 
     /**
      * @desc   : 根据条件进行查询(数量)
@@ -28,6 +34,13 @@ public interface MoneyAccountMapper extends BaseMapper<MoneyAccount>{
      */
     Long countByCond(MoneyAccountQuery moneyAccountQuery);
 
+    /**
+     * @desc   : 小程序列表查询(数量)
+     * @author : 王英杰
+     * @date   : 2024/3/1 10:42
+     */
+    Long wxCountByCond(MoneyAccountQuery moneyAccountQuery);
+
    /**
     * @desc   : 查询
     * @author : 宋扬

+ 22 - 0
src/main/java/com/dk/mdm/mapper/mst/MoneyAccountMapper.xml

@@ -68,6 +68,8 @@
         <include refid="Condition"/>
     </select>
 
+
+
     <!-- 查询表t_mst_money_account,(条件查询)个数 -->
     <select id="countByCond" resultType="Long">
         SELECT
@@ -76,6 +78,26 @@
         <include refid="Condition"/>
     </select>
 
+    <!-- 王英杰 2024年3月6日 微信小程序用 -->
+    <select id="wxSelectByCond" resultMap="BaseResultMap">
+        SELECT
+        tmma.mac_type, tmdd.data_value AS "macTypeName",
+        SUM(balance) AS totalBalance,
+        json_agg(json_build_object('macId', tmma.mac_id, 'macName', tmma.mac_name, 'balance', tmma.balance)) AS subList
+        FROM dkic_b.t_mst_money_account tmma
+        left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmma.mac_type
+        GROUP BY tmma.mac_type,tmdd.data_value
+        <include refid="Condition"/>
+    </select>
+    <!-- 王英杰 2024年3月6日 微信小程序用 -->
+    <select id="wxCountByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_b.t_mst_money_account tmma
+        left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmma.mac_type
+        GROUP BY tmma.mac_type,tmdd.data_value
+        <include refid="Condition"/>
+    </select>
     <!-- 根据主键查询表t_mst_money_account的一行数据 -->
     <select id="selectById" resultMap="BaseResultMap">
         SELECT

+ 11 - 0
src/main/java/com/dk/mdm/model/response/mst/MoneyAccountResponse.java

@@ -1,6 +1,7 @@
 package com.dk.mdm.model.response.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -201,6 +202,16 @@ public class MoneyAccountResponse extends PageInfo<MoneyAccountResponse> impleme
     private String opDbUser;
 
 
+
+    /**
+     * 账户余额
+     */
+    @TableField(exist = false)
+    @ApiModelProperty(value = "合计账户余额")
+    private BigDecimal totalBalance;
+
+
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 1 - 0
src/main/java/com/dk/mdm/model/vo/mst/GoodsSkuVO.java

@@ -1,6 +1,7 @@
 package com.dk.mdm.model.vo.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;

+ 11 - 0
src/main/java/com/dk/mdm/service/mst/MoneyAccountService.java

@@ -62,6 +62,17 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
 				moneyAccountMapper.countByCond(moneyAccountQuery));
 	}
 
+	/**
+	 * @desc   : 维修小程序列表
+	 * @author : 王英杰
+	 * @date   : 2023/2/29 10:40
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<MoneyAccountResponse>> wxSelectByCond(MoneyAccountQuery moneyAccountQuery) {
+		return super.mergeListWithCount(moneyAccountQuery, moneyAccountMapper.wxSelectByCond(moneyAccountQuery),
+				moneyAccountMapper.wxCountByCond(moneyAccountQuery));
+	}
+
 
 	/**
 	 * @desc : 保存方法