From 0989ec1e6b465141f99ed67e40fa2a0b928dce94 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 29 四月 2026 16:54:51 +0800
Subject: [PATCH] feat(production): 新增生产核算和生产工单功能模块 - 添加生产核算控制器、服务接口及实现类 - 实现生产核算分页查询和工人生产工资信息查询功能 - 添加生产工单控制器、服务接口及实现类 - 实现生产工单的增删改查和状态统计功能 - 集成工单流转卡下载和二维码生成功能 - 添加工单相关的数据传输对象和值对象 - 实现工单与用户关联的分配功能 - 完善工单附件图片处理和展示功能
---
src/main/resources/mapper/account/AccountIncomeMapper.xml | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/mapper/account/AccountIncomeMapper.xml b/src/main/resources/mapper/account/AccountIncomeMapper.xml
index 1cb49b9..9becd41 100644
--- a/src/main/resources/mapper/account/AccountIncomeMapper.xml
+++ b/src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -11,13 +11,39 @@
<if test="accountIncome.entryDateStart != null and accountIncome.entryDateStart != '' ">
AND income_date >= DATE_FORMAT(#{accountIncome.entryDateStart},'%Y-%m-%d')
</if>
+ <if test="accountIncome.customerName != null and accountIncome.customerName != '' ">
+ AND customer_name like CONCAT('%',#{accountIncome.customerName},'%')
+ </if>
+
+ <if test="accountIncome.invoiceNumber != null and accountIncome.invoiceNumber != '' ">
+ AND invoice_number like CONCAT('%',#{accountIncome.invoiceNumber},'%')
+ </if>
<if test="accountIncome.entryDateEnd != null and accountIncome.entryDateEnd != '' ">
AND income_date <= DATE_FORMAT(#{accountIncome.entryDateEnd},'%Y-%m-%d')
</if>
<if test="accountIncome.incomeType != null and accountIncome.incomeType != '' ">
AND income_type = #{accountIncome.incomeType}
</if>
- <if test="accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' ">
+ <if test="accountIncome.incomeMethodLabel != null and accountIncome.incomeMethodLabel != ''">
+ AND (
+ (
+ business_type = 1
+ AND income_method in
+ <foreach collection="accountIncome.receiptPaymentMethodList" item="method" open="(" separator="," close=")">
+ #{method}
+ </foreach>
+ )
+ OR
+ (
+ business_type is null
+ AND income_method in
+ <foreach collection="accountIncome.paymentMethodList" item="method" open="(" separator="," close=")">
+ #{method}
+ </foreach>
+ )
+ )
+ </if>
+ <if test="(accountIncome.incomeMethodLabel == null or accountIncome.incomeMethodLabel == '') and accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' ">
AND income_method = #{accountIncome.incomeMethod}
</if>
</select>
@@ -43,7 +69,7 @@
<select id="report" resultType="com.ruoyi.account.dto.AccountDto2">
SELECT
sdd.dict_label typeName,
- sum(income_money) account
+ ifnull(sum(income_money),0) account
FROM account_income ai
left join sys_dict_data sdd on ai.income_type = sdd.dict_value and sdd.dict_type='income_types'
where
@@ -54,11 +80,11 @@
<if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
AND income_date <= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
</if>
- group by income_type
+ GROUP BY sdd.dict_label, ai.income_type
</select>
<select id="report1" resultType="java.math.BigDecimal">
SELECT
- sum(income_money) account
+ ifnull(sum(income_money),0) account
FROM account_income ai
where
income_type=#{dictValue}
@@ -69,4 +95,17 @@
AND income_date <= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
</if>
</select>
+
+ <select id="selectIncomeStats"
+ resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
+ SELECT DATE_FORMAT(income_date, #{dateFormat}) AS dateStr,
+ IFNULL(SUM(income_money), 0) AS amount
+ FROM account_income
+ WHERE income_date BETWEEN #{startDate} AND #{endDate}
+# AND business_type = 1
+ GROUP BY dateStr
+ ORDER BY dateStr
+
+ </select>
+
</mapper>
--
Gitblit v1.9.3