| | |
| | | T2.nick_name AS entry_person_name, |
| | | T1.payment_method, |
| | | DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff, |
| | | T1.delivery_status AS deliveryStatus |
| | | T1.delivery_status AS deliveryStatus, |
| | | T1.order_status AS orderStatus, |
| | | T1.label_print_count AS labelPrintCount, |
| | | T1.document_print_count AS documentPrintCount |
| | | FROM |
| | | sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | |
| | | T1.delivery_date, |
| | | T1.stock_status, |
| | | DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff, |
| | | T1.delivery_status AS deliveryStatus |
| | | T1.delivery_status AS deliveryStatus, |
| | | T1.review_status AS reviewStatus, |
| | | T1.counter_review_time AS counterReviewTime, |
| | | T1.counter_review_person AS counterReviewPerson, |
| | | T1.counter_review_person_id AS counterReviewPersonId, |
| | | T1.counter_review_type AS counterReviewType, |
| | | T1.counter_review_desc AS counterReviewDesc, |
| | | T1.order_status AS orderStatus, |
| | | T1.label_print_count AS labelPrintCount, |
| | | T1.document_print_count AS documentPrintCount |
| | | FROM sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | | <where> |
| | |
| | | <if test="salesLedgerDto.stockStatus != null"> |
| | | AND T1.stock_status = #{salesLedgerDto.stockStatus} |
| | | </if> |
| | | <if test="salesLedgerDto.reviewStatus != null"> |
| | | AND T1.review_status = #{salesLedgerDto.reviewStatus} |
| | | </if> |
| | | <if test="salesLedgerDto.reviewStatusList != null and salesLedgerDto.reviewStatusList.size() > 0"> |
| | | AND ( |
| | | T1.review_status IN |
| | | <foreach collection="salesLedgerDto.reviewStatusList" item="status" open="(" separator="," close=")"> |
| | | #{status} |
| | | </foreach> |
| | | OR T1.review_status IS NULL |
| | | ) |
| | | </if> |
| | | <if test="salesLedgerDto.orderStatus != null"> |
| | | AND T1.order_status = #{salesLedgerDto.orderStatus} |
| | | </if> |
| | | <if test="salesLedgerDto.width != null or salesLedgerDto.height != null"> |
| | | AND EXISTS ( |
| | | SELECT 1 |
| | | FROM sales_ledger_product SLP |
| | | WHERE SLP.sales_ledger_id = T1.id |
| | | AND SLP.type = 1 |
| | | <if test="salesLedgerDto.width != null"> |
| | | AND SLP.width = #{salesLedgerDto.width} |
| | | </if> |
| | | <if test="salesLedgerDto.height != null"> |
| | | AND SLP.height = #{salesLedgerDto.height} |
| | | </if> |
| | | ) |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.entry_date DESC |
| | | ORDER BY T1.entry_date DESC,T1.id DESC |
| | | </select> |
| | | |
| | | <select id="selectIncomeStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto"> |