47个文件已修改
1个文件已删除
26个文件已添加
| | |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | dynamic: |
| | | datasource: |
| | | druid_bip_view: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | username: ${MYSQL-USER:tra_in_mdm@masterdata_mysql#ob_prod_phy_x86_04fa} |
| | | password: ${MYSQL-PWD:L2fbf%2ETRA} |
| | | url: jdbc:mysql://${MYSQL-HOST:10.116.44.42}:${MYSQL-PORT:3306}/${MYSQL-DB:mdm_send}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true |
| | | druid_bip_bank_view: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | username: ${MYSQL-USER:tra_in_mdm@masterdata_mysql#ob_prod_phy_x86_04fa} |
| | | password: ${MYSQL-PWD:L2fbf%2ETRA} |
| | | url: jdbc:mysql://${MYSQL-HOST:10.116.44.42}:${MYSQL-PORT:3306}/${MYSQL-DB:tenant_5}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true |
| | | |
| | | jpa: |
| | | # 自动生成表结构 |
| | | hibernate: |
| | |
| | | server: |
| | | . server: |
| | | port: 8899 # 项目端口 |
| | | servlet: |
| | | context-path: /business # 项目访问路径 |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ContracQueryDTO { |
| | | public class ContracQueryDTO extends HomeQueryDTO{ |
| | | |
| | | @Schema(description = "合同名称") |
| | | private String contractName; |
| | |
| | | |
| | | @Schema(description = "状态") |
| | | private String contractStatus; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ContractInvoiceQueryDTO extends HomeQueryDTO{ |
| | | |
| | | private String contractNo; |
| | | |
| | | private String partyA; |
| | | |
| | | /** |
| | | * 1/蓝 2/红 |
| | | */ |
| | | private String invoiceCategory; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ContractOutBoundQueryDTO extends HomeQueryDTO{ |
| | | |
| | | private String contractNo; |
| | | |
| | | @Schema(description = "客商名称") |
| | | private String busGuestName; |
| | | |
| | | @Schema(description = "标的物名称") |
| | | private String subjectMatterName; |
| | | |
| | | @Schema(description = "标的物编码") |
| | | private String subjectMatterCode; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ContractQueryDTO { |
| | | |
| | | private String contractName; |
| | | |
| | | private String partyA; |
| | | |
| | | private String billingStatus; |
| | | |
| | | /** |
| | | * 1 是 0 否 |
| | | */ |
| | | private String invoiceType; |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CreditSalesQueryDTO { |
| | | public class CreditSalesQueryDTO extends HomeQueryDTO{ |
| | | |
| | | private String contractName; |
| | | private String contractNo; |
| | | |
| | | private String partyA; |
| | | @Schema(description = "客商名称") |
| | | private String busGuestName; |
| | | |
| | | private String productNames; |
| | | @Schema(description = "标的物名称") |
| | | private String subjectMatterName; |
| | | |
| | | private String sortFiled; |
| | | |
| | | private String sortMethod; |
| | | @Schema(description = "标的物编码") |
| | | private String subjectMatterCode; |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CurrentOverdueQueryDTO { |
| | | public class CurrentOverdueQueryDTO extends HomeQueryDTO{ |
| | | |
| | | private String contractName; |
| | | private String contractNo; |
| | | |
| | | private String busGuestName; |
| | | |
| | | private String scheduleName; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class HistoryOverdueQueryDTO extends HomeQueryDTO{ |
| | | |
| | | private String contractNo; |
| | | |
| | | private String busGuestName; |
| | | |
| | | private String scheduleName; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomeQueryDTO { |
| | | |
| | | private Long queryCompId; |
| | | |
| | | /** |
| | | * 1 本日 2 本月 3 本年 |
| | | */ |
| | | private String queryType; |
| | | |
| | | /** |
| | | * 1 东北 2 华北 3 华东 4 中南 5 西南 6 西北 |
| | | */ |
| | | private String queryArea; |
| | | |
| | | /** |
| | | * 1 内销 2 海外 3 外销 |
| | | */ |
| | | private String queryServiceAttr; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date endTime; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class OutBoundQueryDTO { |
| | | |
| | | @Schema(description = "出库批次号") |
| | | private String batchNumber; |
| | | |
| | | @Schema(description = "客商名称") |
| | | private String busGuestName; |
| | | |
| | | @Schema(description = "标的物名称") |
| | | private String subjectMatterName; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date startTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date endTime; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PaymentSlipQueryDTO extends HomeQueryDTO{ |
| | | |
| | | private String contractNo; |
| | | |
| | | private String partyA; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProductAddDTO { |
| | | |
| | | private String erpTypeCode; |
| | | |
| | | private String erpTypeName; |
| | | |
| | | private String erpCode; |
| | | |
| | | private String erpName; |
| | | |
| | | private String specification; |
| | | |
| | | private String taxCode; |
| | | } |
| | |
| | | // private String companyType; |
| | | |
| | | @Schema(description = "法定代表人") |
| | | @Column(columnDefinition = "VARCHAR(20) comment '法定代表人'") |
| | | @Column(columnDefinition = "VARCHAR(128) comment '法定代表人'") |
| | | private String legalPerson; |
| | | |
| | | /* @Schema(description = "注册资本") |
| | |
| | | @Column(columnDefinition = "VARCHAR(20) comment '成立日期'") |
| | | private String establishDate; |
| | | |
| | | @Schema(description = "注册地址") |
| | | @Column(columnDefinition = "VARCHAR(200) comment '注册地址'") |
| | | private String address; |
| | | |
| | | |
| | | @Schema(description = "经营范围") |
| | | @Column(columnDefinition = "TEXT comment '经营范围'") |
| | |
| | | /* @Schema(description = "状态") |
| | | @Column(columnDefinition = "VARCHAR(20) default '正常' comment '状态'") |
| | | private String status;*/ |
| | | |
| | | @Schema(description = "注册地址") |
| | | @Column(columnDefinition = "VARCHAR(400) comment '注册地址'") |
| | | private String address; |
| | | |
| | | @Schema(description = "行业Id") |
| | | @Column(columnDefinition = "VARCHAR(50) comment '行业Id'") |
| | |
| | | private String bankAccount; |
| | | |
| | | @Schema(description = "联系电话") |
| | | @Column(columnDefinition = "VARCHAR(20) comment '联系电话'") |
| | | @Column(columnDefinition = "VARCHAR(40) comment '联系电话'") |
| | | private String contactPhone; |
| | | |
| | | /* @Schema(description = "邮箱") |
| | |
| | | private String invoiceCategory; |
| | | |
| | | @Schema(description = "开票金额(不含税)") |
| | | @Column(columnDefinition="decimal(10,2) comment '开票金额(含税'") |
| | | @Column(columnDefinition="decimal(10,2) comment '开票金额(不含税'") |
| | | private BigDecimal invoiceTotalPrice; |
| | | |
| | | @Schema(description = "开票税额") |
| | |
| | | |
| | | @Schema(description = "Erp出库Id") |
| | | @Column(columnDefinition = "bigint comment 'Erp出库Id'") |
| | | private Long OutBoundId; |
| | | private Long outBoundId; |
| | | |
| | | @Schema(description = "关联合同ID") |
| | | @Column(columnDefinition = "bigint not null comment '关联合同ID'") |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BankNameVo { |
| | | |
| | | private String bankNameCode; |
| | | |
| | | private String bankNameName; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BusinessCustomerSelectVo { |
| | | |
| | | private Long id; |
| | | |
| | | private String companyName; |
| | | |
| | | private String registerName; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CustBankVo { |
| | | |
| | | private String bankAccount; |
| | | |
| | | private String bankName; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CustInfoVo { |
| | | |
| | | private String certificateId; |
| | | |
| | | private String custName; |
| | | |
| | | private String legalGerson; |
| | | |
| | | private String registrationAddress; |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomeCreditSaleVo { |
| | | |
| | | private Long id; |
| | | |
| | | @Schema(description = "合同名称") |
| | | private String contractNo; |
| | | |
| | | @Schema(description = "甲方名称") |
| | | private String busGuestName; |
| | | |
| | | private String subjectMatterName; |
| | | |
| | | private String subjectMatterCode; |
| | | |
| | | @Schema(description = "单价") |
| | | private BigDecimal unitPrice; |
| | | |
| | | @Schema(description = "出库数量") |
| | | private BigDecimal outBoundNum; |
| | | |
| | | @Schema(description = "出库时间") |
| | | @DateTimeFormat(pattern = "yyyy-MM-DD HH:mm:ss") |
| | | private Date outBoundTime; |
| | | |
| | | @Schema(description = "开票数量") |
| | | private BigDecimal invoiceNum; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomeInvoiceVo { |
| | | |
| | | private Long id; |
| | | |
| | | private String busGuestName; |
| | | |
| | | private String invoiceCategory; |
| | | |
| | | private String contractNo; |
| | | |
| | | private String partyB; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date invoiceTime; |
| | | |
| | | private BigDecimal invoiceTotalPriceTax; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomeOutBoundVo { |
| | | |
| | | private Long id; |
| | | |
| | | private String busGuestName; |
| | | |
| | | private String contractNo; |
| | | |
| | | private String subjectMatterName; |
| | | |
| | | private String subjectMatterCode; |
| | | |
| | | private BigDecimal outBoundNum; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-DD HH:mm:ss") |
| | | private Date outBoundTime; |
| | | |
| | | private BigDecimal unitPrice; |
| | | |
| | | private BigDecimal invoiceNum; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomeOverdueStaVo { |
| | | |
| | | /** |
| | | * 1 当前 2 历史 |
| | | */ |
| | | private String overdueType; |
| | | |
| | | private BigDecimal receivableAmount; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomeOverdueVo { |
| | | |
| | | private Long id; |
| | | |
| | | private String busGuestName; |
| | | |
| | | private String contractNo; |
| | | |
| | | private String scheduleName; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-DD") |
| | | private Date contractExpirTime; |
| | | |
| | | private BigDecimal receivableAmount; |
| | | |
| | | private BigDecimal overdueDuration; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class HomePaymentSlipVo { |
| | | |
| | | private Long id; |
| | | |
| | | private String busGuestName; |
| | | |
| | | private String contractNo; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-DD HH:mm:ss") |
| | | private Date paymentTime; |
| | | |
| | | private BigDecimal paymentAmount; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class HomeZbjtVo { |
| | | |
| | | private BigDecimal sgbbr; |
| | | |
| | | private BigDecimal sgbby; |
| | | |
| | | private BigDecimal sgbbn; |
| | | |
| | | private BigDecimal smjbr; |
| | | |
| | | private BigDecimal smjby; |
| | | |
| | | private BigDecimal smjbn; |
| | | |
| | | private BigDecimal jxcbr; |
| | | |
| | | private BigDecimal jxcby; |
| | | |
| | | private BigDecimal jxcbn; |
| | | |
| | | private BigDecimal tfbr; |
| | | |
| | | private BigDecimal tfby; |
| | | |
| | | private BigDecimal tfbn; |
| | | |
| | | private BigDecimal ymjbr; |
| | | |
| | | private BigDecimal ymjby; |
| | | |
| | | private BigDecimal ymjbn; |
| | | |
| | | /** |
| | | * 当前对象减去另一个同类型对象的所有 BigDecimal 字段 |
| | | * @param other 被减数对象 |
| | | * @return 新的 HomeZbjtVo 对象,包含相减后的结果 |
| | | */ |
| | | public HomeZbjtVo subtract(HomeZbjtVo other) { |
| | | if (other == null) { |
| | | // 如果减数为空,返回当前对象的副本(或根据业务逻辑返回当前对象) |
| | | return this.copy(); |
| | | } |
| | | |
| | | HomeZbjtVo result = new HomeZbjtVo(); |
| | | |
| | | // 对每个字段执行减法运算 |
| | | // 注意:处理 null 值,防止 NullPointerException |
| | | result.setSgbbr(safeSubtract(this.sgbbr, other.sgbbr)); |
| | | result.setSgbby(safeSubtract(this.sgbby, other.sgbby)); |
| | | result.setSgbbn(safeSubtract(this.sgbbn, other.sgbbn)); |
| | | result.setSmjbr(safeSubtract(this.smjbr, other.smjbr)); |
| | | result.setSmjby(safeSubtract(this.smjby, other.smjby)); |
| | | result.setSmjbn(safeSubtract(this.smjbn, other.smjbn)); |
| | | result.setJxcbr(safeSubtract(this.jxcbr, other.jxcbr)); |
| | | result.setJxcby(safeSubtract(this.jxcby, other.jxcby)); |
| | | result.setJxcbn(safeSubtract(this.jxcbn, other.jxcbn)); |
| | | result.setTfbr(safeSubtract(this.tfbr, other.tfbr)); |
| | | result.setTfby(safeSubtract(this.tfby, other.tfby)); |
| | | result.setTfbn(safeSubtract(this.tfbn, other.tfbn)); |
| | | result.setYmjbr(safeSubtract(this.ymjbr, other.ymjbr)); |
| | | result.setYmjby(safeSubtract(this.ymjby, other.ymjby)); |
| | | result.setYmjbn(safeSubtract(this.ymjby, other.ymjby)); |
| | | // ... 对其他所有 BigDecimal 字段执行相同操作 |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 安全减法工具方法:处理 null 值情况 |
| | | * 规则:null 视为 0 |
| | | */ |
| | | private BigDecimal safeSubtract(BigDecimal minuend, BigDecimal subtrahend) { |
| | | BigDecimal val1 = minuend == null ? BigDecimal.ZERO : minuend; |
| | | BigDecimal val2 = subtrahend == null ? BigDecimal.ZERO : subtrahend; |
| | | return val1.subtract(val2); |
| | | } |
| | | |
| | | /** |
| | | * 辅助方法:复制当前对象(用于减数为null时的返回) |
| | | */ |
| | | public HomeZbjtVo copy() { |
| | | HomeZbjtVo copy = new HomeZbjtVo(); |
| | | copy.setSgbbr(this.sgbbr); |
| | | copy.setSgbby(this.sgbby); |
| | | copy.setSgbbn(this.sgbbn); |
| | | copy.setSmjbr(this.smjbr); |
| | | copy.setSmjby(this.smjby); |
| | | copy.setSmjbn(this.smjbn); |
| | | copy.setJxcbr(this.jxcbr); |
| | | copy.setJxcby(this.jxcby); |
| | | copy.setJxcbn(this.jxcbn); |
| | | copy.setTfbr(this.tfbr); |
| | | copy.setTfby(this.tfby); |
| | | copy.setTfbn(this.tfbn); |
| | | copy.setYmjbr(this.ymjbr); |
| | | copy.setYmjby(this.ymjby); |
| | | copy.setYmjbn(this.ymjby); |
| | | // ... 复制其他字段 |
| | | return copy; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当前对象减去另一个同类型对象的所有 BigDecimal 字段 |
| | | * @param other 被减数对象 |
| | | * @return 新的 HomeZbjtVo 对象,包含相减后的结果 |
| | | */ |
| | | public HomeZbjtVo add(HomeZbjtVo other) { |
| | | if (other == null) { |
| | | // 如果减数为空,返回当前对象的副本(或根据业务逻辑返回当前对象) |
| | | return this.copy(); |
| | | } |
| | | |
| | | HomeZbjtVo result = new HomeZbjtVo(); |
| | | |
| | | // 对每个字段执行减法运算 |
| | | // 注意:处理 null 值,防止 NullPointerException |
| | | result.setSgbbr(safeAdd(this.sgbbr, other.sgbbr)); |
| | | result.setSgbby(safeAdd(this.sgbby, other.sgbby)); |
| | | result.setSgbbn(safeAdd(this.sgbbn, other.sgbbn)); |
| | | result.setSmjbr(safeAdd(this.smjbr, other.smjbr)); |
| | | result.setSmjby(safeAdd(this.smjby, other.smjby)); |
| | | result.setSmjbn(safeAdd(this.smjbn, other.smjbn)); |
| | | result.setJxcbr(safeAdd(this.jxcbr, other.jxcbr)); |
| | | result.setJxcby(safeAdd(this.jxcby, other.jxcby)); |
| | | result.setJxcbn(safeAdd(this.jxcbn, other.jxcbn)); |
| | | result.setTfbr(safeAdd(this.tfbr, other.tfbr)); |
| | | result.setTfby(safeAdd(this.tfby, other.tfby)); |
| | | result.setTfbn(safeAdd(this.tfbn, other.tfbn)); |
| | | result.setYmjbr(safeAdd(this.ymjbr, other.ymjbr)); |
| | | result.setYmjby(safeAdd(this.ymjby, other.ymjby)); |
| | | result.setYmjbn(safeAdd(this.ymjby, other.ymjby)); |
| | | // ... 对其他所有 BigDecimal 字段执行相同操作 |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 安全减法工具方法:处理 null 值情况 |
| | | * 规则:null 视为 0 |
| | | */ |
| | | private BigDecimal safeAdd(BigDecimal minuend, BigDecimal subtrahend) { |
| | | BigDecimal val1 = minuend == null ? BigDecimal.ZERO : minuend; |
| | | BigDecimal val2 = subtrahend == null ? BigDecimal.ZERO : subtrahend; |
| | | return val1.add(val2); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class HomeZgsVo { |
| | | |
| | | private BigDecimal hbbr; |
| | | |
| | | private BigDecimal hbby; |
| | | |
| | | private BigDecimal hbbn; |
| | | |
| | | private BigDecimal xbbr; |
| | | |
| | | private BigDecimal xbby; |
| | | |
| | | private BigDecimal xbbn; |
| | | |
| | | private BigDecimal dbbr; |
| | | |
| | | private BigDecimal dbby; |
| | | |
| | | private BigDecimal dbbn; |
| | | |
| | | private BigDecimal hdbr; |
| | | |
| | | private BigDecimal hdby; |
| | | |
| | | private BigDecimal hdbn; |
| | | |
| | | private BigDecimal xnbr; |
| | | |
| | | private BigDecimal xnby; |
| | | |
| | | private BigDecimal xnbn; |
| | | |
| | | private BigDecimal znbr; |
| | | |
| | | private BigDecimal znby; |
| | | |
| | | private BigDecimal znbn; |
| | | |
| | | private BigDecimal hwbr; |
| | | |
| | | private BigDecimal hwby; |
| | | |
| | | private BigDecimal hwbn; |
| | | |
| | | /** |
| | | * 当前对象减去另一个同类型对象的所有 BigDecimal 字段 |
| | | * @param other 被减数对象 |
| | | * @return 新的 HomeZbjtVo 对象,包含相减后的结果 |
| | | */ |
| | | public HomeZgsVo subtract(HomeZgsVo other) { |
| | | if (other == null) { |
| | | // 如果减数为空,返回当前对象的副本(或根据业务逻辑返回当前对象) |
| | | return this.copy(); |
| | | } |
| | | |
| | | HomeZgsVo result = new HomeZgsVo(); |
| | | |
| | | // 对每个字段执行减法运算 |
| | | // 注意:处理 null 值,防止 NullPointerException |
| | | result.setHbbr(safeSubtract(this.hbbr,other.hbbr)); |
| | | result.setHbby(safeSubtract(this.hbby,other.hbby)); |
| | | result.setHbbn(safeSubtract(this.hbbn,other.hbbn)); |
| | | result.setXbbr(safeSubtract(this.xbbr,other.xbbr)); |
| | | result.setXbby(safeSubtract(this.xbby,other.xbby)); |
| | | result.setXbbn(safeSubtract(this.xbbn,other.xbbn)); |
| | | result.setDbbr(safeSubtract(this.dbbr,other.dbbr)); |
| | | result.setDbby(safeSubtract(this.dbby,other.dbby)); |
| | | result.setDbbn(safeSubtract(this.dbbn,other.dbbn)); |
| | | result.setHwbr(safeSubtract(this.hwbr,other.hwbr)); |
| | | result.setHwby(safeSubtract(this.hwby,other.hwby)); |
| | | result.setHwbn(safeSubtract(this.hwbn,other.hwbn)); |
| | | // ... 对其他所有 BigDecimal 字段执行相同操作 |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 安全减法工具方法:处理 null 值情况 |
| | | * 规则:null 视为 0 |
| | | */ |
| | | private BigDecimal safeSubtract(BigDecimal minuend, BigDecimal subtrahend) { |
| | | BigDecimal val1 = minuend == null ? BigDecimal.ZERO : minuend; |
| | | BigDecimal val2 = subtrahend == null ? BigDecimal.ZERO : subtrahend; |
| | | return val1.subtract(val2); |
| | | } |
| | | |
| | | /** |
| | | * 辅助方法:复制当前对象(用于减数为null时的返回) |
| | | */ |
| | | public HomeZgsVo copy() { |
| | | HomeZgsVo copy = new HomeZgsVo(); |
| | | copy.setHbbr(this.hbbr); |
| | | copy.setHbby(this.hbby); |
| | | copy.setHbbn(this.hbbn); |
| | | copy.setXbbr(this.xbbr); |
| | | copy.setXbby(this.xbby); |
| | | copy.setXbbn(this.xbby); |
| | | copy.setDbbr(this.dbbr); |
| | | copy.setDbby(this.dbby); |
| | | copy.setDbbn(this.dbbn); |
| | | copy.setHwbr(this.hwbr); |
| | | copy.setHwby(this.hwby); |
| | | copy.setHwbn(this.hwbn); |
| | | copy.setHdbr(this.hdbr); |
| | | copy.setHdby(this.hdby); |
| | | copy.setHdbn(this.hdbn); |
| | | copy.setXnbr(this.xnbr); |
| | | copy.setXnby(this.xnby); |
| | | copy.setXnbn(this.xnbr); |
| | | copy.setZnbr(this.znbr); |
| | | copy.setZnby(this.znby); |
| | | copy.setZnbn(this.znbn); |
| | | // ... 复制其他字段 |
| | | return copy; |
| | | } |
| | | |
| | | /** |
| | | * 当前对象减去另一个同类型对象的所有 BigDecimal 字段 |
| | | * @param other 被减数对象 |
| | | * @return 新的 HomeZbjtVo 对象,包含相减后的结果 |
| | | */ |
| | | public HomeZgsVo add(HomeZgsVo other) { |
| | | if (other == null) { |
| | | // 如果减数为空,返回当前对象的副本(或根据业务逻辑返回当前对象) |
| | | return this.copy(); |
| | | } |
| | | |
| | | HomeZgsVo result = new HomeZgsVo(); |
| | | |
| | | // 对每个字段执行减法运算 |
| | | // 注意:处理 null 值,防止 NullPointerException |
| | | result.setHbbr(safeAdd(this.hbbr,other.hbbr)); |
| | | result.setHbby(safeAdd(this.hbby,other.hbby)); |
| | | result.setHbbn(safeAdd(this.hbbn,other.hbbn)); |
| | | result.setXbbr(safeAdd(this.xbbr,other.xbbr)); |
| | | result.setXbby(safeAdd(this.xbby,other.xbby)); |
| | | result.setXbbn(safeAdd(this.xbbn,other.xbbn)); |
| | | result.setDbbr(safeAdd(this.dbbr,other.dbbr)); |
| | | result.setDbby(safeAdd(this.dbby,other.dbby)); |
| | | result.setDbbn(safeAdd(this.dbbn,other.dbbn)); |
| | | result.setHwbr(safeAdd(this.hwbr,other.hwbr)); |
| | | result.setHwby(safeAdd(this.hwby,other.hwby)); |
| | | result.setHwbn(safeAdd(this.hwbn,other.hwbn)); |
| | | result.setHdbr(safeAdd(this.hdbr,other.hdbr)); |
| | | result.setHdby(safeAdd(this.hdby,other.hdby)); |
| | | result.setHdbn(safeAdd(this.hdbn,other.hdbn)); |
| | | result.setXnbr(safeAdd(this.xnbr,other.xnbr)); |
| | | result.setXnby(safeAdd(this.xnby,other.xnby)); |
| | | result.setXnbn(safeAdd(this.xnbn,other.xnbn)); |
| | | result.setZnbr(safeAdd(this.znbr,other.znbr)); |
| | | result.setZnby(safeAdd(this.znby,other.znby)); |
| | | result.setZnbn(safeAdd(this.znbn,other.znbn)); |
| | | // ... 对其他所有 BigDecimal 字段执行相同操作 |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 安全减法工具方法:处理 null 值情况 |
| | | * 规则:null 视为 0 |
| | | */ |
| | | private BigDecimal safeAdd(BigDecimal minuend, BigDecimal subtrahend) { |
| | | BigDecimal val1 = minuend == null ? BigDecimal.ZERO : minuend; |
| | | BigDecimal val2 = subtrahend == null ? BigDecimal.ZERO : subtrahend; |
| | | return val1.add(val2); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.by4cloud.platformx.common.excel.annotation.ExcelLine; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProductExcelVO { |
| | | |
| | | /** |
| | | * 导入时候回显行号 |
| | | */ |
| | | @ExcelLine |
| | | @ExcelIgnore |
| | | private Long lineNum; |
| | | |
| | | @ExcelProperty("erp分类编码") |
| | | private String erpTypeCode; |
| | | |
| | | @ExcelProperty("erp分类名称") |
| | | private String erpTypeName; |
| | | |
| | | @NotBlank(message = "erp编码不能为空") |
| | | @ExcelProperty("erp编码") |
| | | private String erpCode; |
| | | |
| | | @NotBlank(message = "erp名称不能为空") |
| | | @ExcelProperty("erp名称") |
| | | private String erpName; |
| | | |
| | | @ExcelProperty("规格") |
| | | private String specification; |
| | | |
| | | @NotBlank(message = "税收编码不能为空") |
| | | @ExcelProperty("税收编码") |
| | | private String taxCode; |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.vo.BusinessCustomerSelectVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.business.entity.BusinessCustomer; |
| | | import com.by4cloud.platformx.business.service.BusinessCustomerService; |
| | | import com.by4cloud.platformx.common.security.annotation.Inner; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | |
| | | public R getBusinessCustomerList(@ParameterObject BusinessCustomer businessCustomer) { |
| | | LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); |
| | | return R.ok(businessCustomerService.listByScope(wrapper)); |
| | | List<BusinessCustomer> businessCustomerList = businessCustomerService.listByScope(wrapper); |
| | | if (ArrayUtil.isNotEmpty(businessCustomerList.toArray())){ |
| | | List<BusinessCustomerSelectVo> voList = BeanUtil.copyToList(businessCustomerList, BusinessCustomerSelectVo.class); |
| | | if (voList.size()>1000){ |
| | | return R.ok(voList.subList(0,1000)); |
| | | } |
| | | return R.ok(voList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<BusinessCustomer> export(BusinessCustomer businessCustomer,Long[] ids) { |
| | | return businessCustomerService.list(Wrappers.lambdaQuery(businessCustomer).in(ArrayUtil.isNotEmpty(ids), BusinessCustomer::getId, ids)); |
| | | } |
| | | |
| | | /** |
| | | * 同步主数据 企业名称 法人 三合一码 银行信息 |
| | | * @return R |
| | | */ |
| | | @Inner(value = false) |
| | | @GetMapping("/syncMainBusCus" ) |
| | | public R syncMainBusCus() { |
| | | return R.ok(businessCustomerService.syncMainBusCus()); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContractInvoiceQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.ContractQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.GenInvoiceInfoDTO; |
| | | import com.by4cloud.platformx.business.entity.Contract; |
| | | import com.by4cloud.platformx.business.service.ContractInvoiceService; |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param contract 合同管理 |
| | | * @param queryDTO 合同管理 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | public R getContractPage(@ParameterObject Page page, @ParameterObject Contract contract) { |
| | | public R getContractPage(@ParameterObject Page page, @ParameterObject ContractQueryDTO queryDTO) { |
| | | LambdaQueryWrapper<Contract> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StringUtils.isNotBlank(contract.getContractName()),Contract::getContractName,contract.getContractName()); |
| | | wrapper.like(StringUtils.isNotBlank(contract.getPartyA()),Contract::getPartyA,contract.getPartyA()); |
| | | wrapper.eq(Contract::getBillingStatus,contract.getBillingStatus()); |
| | | if (StrUtil.equals(contract.getBillingStatus(),"1")){ |
| | | wrapper.like(StringUtils.isNotBlank(queryDTO.getContractName()),Contract::getContractName,queryDTO.getContractName()); |
| | | wrapper.like(StringUtils.isNotBlank(queryDTO.getPartyA()),Contract::getPartyA,queryDTO.getPartyA()); |
| | | wrapper.eq(Contract::getBillingStatus,queryDTO.getBillingStatus()); |
| | | if (StrUtil.equals(queryDTO.getInvoiceType(),"1")){ |
| | | wrapper.eqSql(Contract::getBillingAmout,"(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = contract.id)"); |
| | | }else if (StrUtil.equals(queryDTO.getInvoiceType(),"0")){ |
| | | wrapper.ltSql(Contract::getBillingAmout,"(select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = contract.id)"); |
| | | } |
| | | |
| | | if (StrUtil.equals(queryDTO.getBillingStatus(),"1")){ |
| | | wrapper.orderByDesc(BaseModel::getCreateTime); |
| | | }else { |
| | | wrapper.orderByAsc(BaseModel::getCreateTime); |
| | |
| | | public R queryRedInvoice() { |
| | | return contractInvoiceService.queryRedInvoice(); |
| | | } |
| | | |
| | | @GetMapping("/pageInvoice") |
| | | public R pageInvoice(@ParameterObject Page page, @ParameterObject ContractInvoiceQueryDTO queryDTO) { |
| | | return R.ok(contractInvoiceService.pageInvoice(page, queryDTO)); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContractOutBoundQueryDTO; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.business.entity.ContractOutBound; |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param contractOutBound 合同出库 |
| | | * @param queryDTO 合同出库 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_contractOutBound_view')" ) |
| | | public R getContractOutBoundPage(@ParameterObject Page page, @ParameterObject ContractOutBound contractOutBound) { |
| | | LambdaQueryWrapper<ContractOutBound> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotBlank(contractOutBound.getBusGuestName()),ContractOutBound::getBusGuestName,contractOutBound.getBusGuestName()); |
| | | wrapper.like(StrUtil.isNotBlank(contractOutBound.getContractName()),ContractOutBound::getContractName,contractOutBound.getContractName()); |
| | | wrapper.like(StrUtil.isNotBlank(contractOutBound.getSubjectMatterName()),ContractOutBound::getSubjectMatterName,contractOutBound.getSubjectMatterName()); |
| | | wrapper.orderByDesc(ContractOutBound::getCreateTime); |
| | | return R.ok(contractOutBoundService.pageByScope(page, wrapper)); |
| | | public R getContractOutBoundPage(@ParameterObject Page page, @ParameterObject ContractOutBoundQueryDTO queryDTO) { |
| | | // LambdaQueryWrapper<ContractOutBound> wrapper = Wrappers.lambdaQuery(); |
| | | // wrapper.like(StrUtil.isNotBlank(contractOutBound.getBusGuestName()),ContractOutBound::getBusGuestName,contractOutBound.getBusGuestName()); |
| | | // wrapper.like(StrUtil.isNotBlank(contractOutBound.getContractName()),ContractOutBound::getContractName,contractOutBound.getContractName()); |
| | | // wrapper.like(StrUtil.isNotBlank(contractOutBound.getSubjectMatterName()),ContractOutBound::getSubjectMatterName,contractOutBound.getSubjectMatterName()); |
| | | // wrapper.orderByDesc(ContractOutBound::getCreateTime); |
| | | return R.ok(contractOutBoundService.pageScope(page, queryDTO)); |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param currentOverdue 未关闭合同(当前逾期) |
| | | * @param queryDTO 未关闭合同(当前逾期) |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_currentOverdue_view')" ) |
| | | public R getCurrentOverduePage(@ParameterObject Page page, @ParameterObject CurrentOverdue currentOverdue) { |
| | | LambdaQueryWrapper<CurrentOverdue> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotBlank(currentOverdue.getBusGuestName()),CurrentOverdue::getBusGuestName,currentOverdue.getBusGuestName()); |
| | | wrapper.like(StrUtil.isNotBlank(currentOverdue.getContractName()),CurrentOverdue::getContractName,currentOverdue.getContractName()); |
| | | wrapper.like(StrUtil.isNotBlank(currentOverdue.getScheduleName()),CurrentOverdue::getScheduleName,currentOverdue.getScheduleName()); |
| | | wrapper.orderByDesc(CurrentOverdue::getCreateTime); |
| | | return R.ok(currentOverdueService.pageByScope(page, wrapper)); |
| | | public R getCurrentOverduePage(@ParameterObject Page page, @ParameterObject CurrentOverdueQueryDTO queryDTO) { |
| | | // LambdaQueryWrapper<CurrentOverdue> wrapper = Wrappers.lambdaQuery(); |
| | | // wrapper.like(StrUtil.isNotBlank(currentOverdue.getBusGuestName()),CurrentOverdue::getBusGuestName,currentOverdue.getBusGuestName()); |
| | | // wrapper.like(StrUtil.isNotBlank(currentOverdue.getContractName()),CurrentOverdue::getContractName,currentOverdue.getContractName()); |
| | | // wrapper.like(StrUtil.isNotBlank(currentOverdue.getScheduleName()),CurrentOverdue::getScheduleName,currentOverdue.getScheduleName()); |
| | | // wrapper.orderByDesc(CurrentOverdue::getCreateTime); |
| | | return R.ok(currentOverdueService.pageScope(page, queryDTO)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.HistoryOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.CurrentOverdue; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param historyOverdue 历史逾期 |
| | | * @param queryDTO 历史逾期 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_historyOverdue_view')" ) |
| | | public R getHistoryOverduePage(@ParameterObject Page page, @ParameterObject HistoryOverdue historyOverdue) { |
| | | LambdaQueryWrapper<HistoryOverdue> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotBlank(historyOverdue.getBusGuestName()),HistoryOverdue::getBusGuestName,historyOverdue.getBusGuestName()); |
| | | wrapper.like(StrUtil.isNotBlank(historyOverdue.getContractName()),HistoryOverdue::getContractName,historyOverdue.getContractName()); |
| | | wrapper.like(StrUtil.isNotBlank(historyOverdue.getScheduleName()), HistoryOverdue::getScheduleName,historyOverdue.getScheduleName()); |
| | | wrapper.orderByDesc(HistoryOverdue::getCreateTime); |
| | | return R.ok(historyOverdueService.pageByScope(page, wrapper)); |
| | | public R getHistoryOverduePage(@ParameterObject Page page, @ParameterObject HistoryOverdueQueryDTO queryDTO) { |
| | | // LambdaQueryWrapper<HistoryOverdue> wrapper = Wrappers.lambdaQuery(); |
| | | // wrapper.like(StrUtil.isNotBlank(historyOverdue.getBusGuestName()),HistoryOverdue::getBusGuestName,historyOverdue.getBusGuestName()); |
| | | // wrapper.like(StrUtil.isNotBlank(historyOverdue.getContractName()),HistoryOverdue::getContractName,historyOverdue.getContractName()); |
| | | // wrapper.like(StrUtil.isNotBlank(historyOverdue.getScheduleName()), HistoryOverdue::getScheduleName,historyOverdue.getScheduleName()); |
| | | // wrapper.orderByDesc(HistoryOverdue::getCreateTime); |
| | | return R.ok(historyOverdueService.pageScope(page, queryDTO)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.by4cloud.platformx.business.controller; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.OutBoundAddDTO; |
| | | import com.by4cloud.platformx.business.dto.OutBoundQueryDTO; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.business.entity.OutBound; |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param outBound EPR出库记录 |
| | | * @param queryDTO EPR出库记录 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_outBound_view')" ) |
| | | public R getOutBoundPage(@ParameterObject Page page, @ParameterObject OutBound outBound) { |
| | | public R getOutBoundPage(@ParameterObject Page page, @ParameterObject OutBoundQueryDTO queryDTO) { |
| | | LambdaQueryWrapper<OutBound> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotBlank(outBound.getBusGuestName()),OutBound::getBusGuestName,outBound.getBusGuestName()); |
| | | wrapper.like(StrUtil.isNotBlank(outBound.getSubjectMatterName()),OutBound::getSubjectMatterName,outBound.getSubjectMatterName()); |
| | | wrapper.like(StrUtil.isNotBlank(queryDTO.getBusGuestName()),OutBound::getBusGuestName,queryDTO.getBusGuestName()); |
| | | wrapper.like(StrUtil.isNotBlank(queryDTO.getSubjectMatterName()),OutBound::getSubjectMatterName,queryDTO.getSubjectMatterName()); |
| | | wrapper.like(StrUtil.isNotBlank(queryDTO.getBatchNumber()),OutBound::getBatchNumber,queryDTO.getBatchNumber()); |
| | | wrapper.ge(ObjUtil.isNotNull(queryDTO.getStartTime()),OutBound::getOutBoundTime,queryDTO.getStartTime()); |
| | | wrapper.le(ObjUtil.isNotNull(queryDTO.getEndTime()),OutBound::getOutBoundTime,queryDTO.getEndTime()); |
| | | wrapper.orderByDesc(OutBound::getCreateTime); |
| | | return R.ok(outBoundService.pageByScope(page, wrapper)); |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.controller; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.PaymentConfirmQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentConfirm; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | import com.by4cloud.platformx.business.service.PaymentSlipService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springdoc.core.annotations.ParameterObject; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 收款单 |
| | | * |
| | | * @author syt |
| | | * @date 2026年7月16日 15:03:33 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/paymentSlip" ) |
| | | @Tag(description = "paymentSlip" , name = "收款单" ) |
| | | @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) |
| | | public class PaymentSlipController { |
| | | |
| | | private final PaymentSlipService paymentSlipService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param queryDTO 收款单 |
| | | * @return |
| | | */ |
| | | @GetMapping("/page" ) |
| | | public R getPaymentConfirmPage(@ParameterObject Page page, @ParameterObject PaymentSlipQueryDTO queryDTO) { |
| | | return R.ok(paymentSlipService.pageScope(page, queryDTO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.admin.api.vo.DeptExcelVO; |
| | | import com.by4cloud.platformx.business.dto.ProductAddDTO; |
| | | import com.by4cloud.platformx.business.dto.ProductQueryDTO; |
| | | import com.by4cloud.platformx.business.vo.ProductExcelVO; |
| | | import com.by4cloud.platformx.business.vo.ProductTreeVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.excel.annotation.RequestExcel; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.business.entity.Product; |
| | | import com.by4cloud.platformx.business.service.ProductService; |
| | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | public List<Product> export(Product product,Long[] ids) { |
| | | return productService.list(Wrappers.lambdaQuery(product).in(ArrayUtil.isNotEmpty(ids), Product::getId, ids)); |
| | | } |
| | | |
| | | /** |
| | | * 新增产品信息 |
| | | * @param addDTOS 产品信息 |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "各公司新增产品信息" , description = "各公司新增产品信息" ) |
| | | @SysLog("各公司新增产品信息" ) |
| | | @PostMapping("/saveErpProduct") |
| | | public R saveErpProduct(@RequestBody List<ProductAddDTO> addDTOS) { |
| | | return productService.saveErpProduct(addDTOS); |
| | | } |
| | | |
| | | /** |
| | | * 导入部门 |
| | | * @param excelVOList |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping("/importProduct") |
| | | public R importProduct(@RequestExcel List<ProductExcelVO> excelVOList, BindingResult bindingResult) { |
| | | return productService.importProduct(excelVOList, bindingResult); |
| | | } |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.controller; |
| | | |
| | | import com.by4cloud.platformx.business.dto.AnalysisCommonDTO; |
| | | import com.by4cloud.platformx.business.dto.HomeQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.SalesMan; |
| | | import com.by4cloud.platformx.business.service.StatisticService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | |
| | | public R agingAnalysisTotalScale(@RequestBody AnalysisCommonDTO commonDTO) { |
| | | return statisticService.agingAnalysisTotalScale(commonDTO); |
| | | } |
| | | |
| | | /** |
| | | * 装备集团角色判断 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeZbjtFlag") |
| | | public R homeZbjtFlag() { |
| | | return statisticService.homeZbjtFlag(); |
| | | } |
| | | |
| | | /** |
| | | * 装备集团首页 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeZbjt") |
| | | public R homeZbjt() { |
| | | return statisticService.homeZbjt(); |
| | | } |
| | | |
| | | /** |
| | | * 子公司首页 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeZgs") |
| | | public R homeZgs() { |
| | | return statisticService.homeZgs(); |
| | | } |
| | | |
| | | /** |
| | | * 合同签订首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeContract") |
| | | public R homeContract(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homeContract(queryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 回款首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homePaymentSlip") |
| | | public R homePaymentSlip(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homePaymentSlip(queryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 出货首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeOutBound") |
| | | public R homeOutBound(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homeOutBound(queryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 开票首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeInvoice") |
| | | public R homeInvoice(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homeInvoice(queryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 赊销首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeCreditSale") |
| | | public R homeCreditSale(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homeCreditSale(queryDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 逾期首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeOverdue") |
| | | public R homeOverdue(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homeOverdue(queryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 逾期历史首页穿透 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/homeOverdueHis") |
| | | public R homeOverdueHis(@RequestBody HomeQueryDTO queryDTO) { |
| | | return statisticService.homeOverdueHis(queryDTO); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.by4cloud.platformx.business.vo.BankNameVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | @Mapper |
| | | @DS("druid_bip_bank_view") |
| | | public interface BipBanklViewMapper { |
| | | |
| | | @Select("SELECT bnts.bank_name_code,bnts.bank_name_name FROM tenant_5.bank_name_tra_send AS bnts WHERE bnts.bank_name_code = #{bankName}") |
| | | BankNameVo selectBankByCode(String bankName); |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.by4cloud.platformx.business.vo.CustBankVo; |
| | | import com.by4cloud.platformx.business.vo.CustInfoVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | @Mapper |
| | | @DS("druid_bip_view") |
| | | public interface BipViewMapper { |
| | | |
| | | @Select("select certificate_id, cust_name,legal_person,registration_address from mdm_send.mdm_cust_base_info_tra_send WHERE cust_name = #{companyName}") |
| | | CustInfoVo selectBaseInfoByCustName(String companyName); |
| | | |
| | | @Select("SELECT mcbats.bank_account,mcbats.bank_name FROM mdm_send.mdm_cust_bank_account_tra_send AS mcbats WHERE holder_name = #{companyName}") |
| | | CustBankVo selectBankByCustName(String companyName); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContractInvoiceQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.ContractInvoice; |
| | | import com.by4cloud.platformx.business.vo.HomeInvoiceVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZbjtVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZgsVo; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface ContractInvoiceMapper extends PlatformxBaseMapper<ContractInvoice> { |
| | | HomeZbjtVo homeZbjt(); |
| | | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | |
| | | Page<HomeInvoiceVo> pageInvoice(Page page,@Param("queryDTO") ContractInvoiceQueryDTO queryDTO, DataScope comp_id); |
| | | } |
| | |
| | | @Param("tfCompId") Long tfgs,@Param("ymjCompId") Long ymj); |
| | | |
| | | Page<ContractPageVo> pageScope(Page page,@Param("queryDTO") ContracQueryDTO queryDTO, DataScope comp_id); |
| | | |
| | | HomeZbjtVo homeZbjt(); |
| | | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContractOutBoundQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.CreditSalesQueryDTO; |
| | | import com.by4cloud.platformx.business.vo.HomeOutBoundVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZbjtVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZgsVo; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import com.by4cloud.platformx.business.entity.ContractOutBound; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface ContractOutBoundMapper extends PlatformxBaseMapper<ContractOutBound> { |
| | | |
| | | |
| | | HomeZbjtVo homeZbjt(); |
| | | |
| | | HomeZbjtVo homeZbjtSX(); |
| | | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | |
| | | HomeZgsVo homeZgsSX(@Param("compId")Long compId); |
| | | |
| | | Page<HomeOutBoundVo> pageScope(Page page, @Param("queryDTO") ContractOutBoundQueryDTO queryDTO, DataScope comp_id); |
| | | |
| | | Page<HomeOutBoundVo> pageByCredit(Page page,@Param("queryDTO") CreditSalesQueryDTO queryDTO, DataScope comp_id); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.CurrentOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.HomeQueryDTO; |
| | | import com.by4cloud.platformx.business.vo.HomeOverdueStaVo; |
| | | import com.by4cloud.platformx.business.vo.HomeOverdueVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZbjtVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZgsVo; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import com.by4cloud.platformx.business.entity.CurrentOverdue; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface CurrentOverdueMapper extends PlatformxBaseMapper<CurrentOverdue> { |
| | | |
| | | |
| | | HomeZbjtVo homeZbjt(); |
| | | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | |
| | | Page<HomeOverdueVo> pageScope(Page page, @Param("queryDTO") CurrentOverdueQueryDTO queryDTO, DataScope comp_id); |
| | | |
| | | HomeOverdueStaVo selectCurrentOverdue(@Param("queryDTO")HomeQueryDTO queryDTO); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.HistoryOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.HomeQueryDTO; |
| | | import com.by4cloud.platformx.business.vo.HomeOverdueStaVo; |
| | | import com.by4cloud.platformx.business.vo.HomeOverdueVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZbjtVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZgsVo; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import com.by4cloud.platformx.business.entity.HistoryOverdue; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface HistoryOverdueMapper extends PlatformxBaseMapper<HistoryOverdue> { |
| | | |
| | | |
| | | HomeZbjtVo homeZbjt(); |
| | | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | |
| | | HomeOverdueStaVo selectHistoryOverdue(@Param("queryDTO")HomeQueryDTO queryDTO); |
| | | |
| | | Page<HomeOverdueVo> pageScope(Page page, @Param("queryDTO") HistoryOverdueQueryDTO queryDTO, DataScope comp_id); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | |
| | | import com.by4cloud.platformx.business.vo.HomeOutBoundVo; |
| | | import com.by4cloud.platformx.business.vo.HomePaymentSlipVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZbjtVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZgsVo; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface PaymentSlipMapper extends PlatformxBaseMapper<PaymentSlip> { |
| | | |
| | | |
| | | HomeZbjtVo homeZbjt(); |
| | | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | |
| | | Page<HomePaymentSlipVo> pageScope(Page page, @Param("queryDTO") PaymentSlipQueryDTO queryDTO, DataScope comp_id); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.by4cloud.platformx.business.entity.BusinessCustomer; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface BusinessCustomerService extends IIService<BusinessCustomer> { |
| | | |
| | | R syncMainBusCus(); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContractInvoiceQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.GenInvoiceInfoDTO; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | |
| | |
| | | void takeEffect(Long id); |
| | | |
| | | void refuseApproval(Long id); |
| | | |
| | | Page pageInvoice(Page page, ContractInvoiceQueryDTO queryDTO); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContractOutBoundQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.ContractOutBound; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface ContractOutBoundService extends IIService<ContractOutBound> { |
| | | |
| | | Page pageScope(Page page, ContractOutBoundQueryDTO queryDTO); |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.ContracQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.ContractAddDTO; |
| | | import com.by4cloud.platformx.business.dto.ContractUpdateDTO; |
| | | import com.by4cloud.platformx.business.dto.DelayOutApprovalDTO; |
| | | import com.by4cloud.platformx.business.dto.*; |
| | | import com.by4cloud.platformx.business.entity.Contract; |
| | | import com.by4cloud.platformx.business.vo.ContractDetailVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | |
| | | R addContractSgb(ContractAddDTO addDTO); |
| | | |
| | | R updateContractSgb(ContractUpdateDTO addDTO); |
| | | |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.CurrentOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.CurrentOverdue; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface CurrentOverdueService extends IIService<CurrentOverdue> { |
| | | |
| | | Page pageScope(Page page, CurrentOverdueQueryDTO queryDTO); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.HistoryOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.HistoryOverdue; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface HistoryOverdueService extends IIService<HistoryOverdue> { |
| | | |
| | | Page pageScope(Page page, HistoryOverdueQueryDTO queryDTO); |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface PaymentSlipService extends IIService<PaymentSlip> { |
| | | Page pageScope(Page page, PaymentSlipQueryDTO queryDTO); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import com.by4cloud.platformx.business.dto.ProductAddDTO; |
| | | import com.by4cloud.platformx.business.dto.ProductQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.Product; |
| | | import com.by4cloud.platformx.business.vo.ProductExcelVO; |
| | | import com.by4cloud.platformx.business.vo.ProductSelectVo; |
| | | import com.by4cloud.platformx.business.vo.ProductTreeVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | import org.springframework.validation.BindingResult; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | List<ProductSelectVo> getProductList(Product product); |
| | | |
| | | R getProductListByParentId(ProductQueryDTO queryDTO); |
| | | |
| | | R saveErpProduct(List<ProductAddDTO> addDTOS); |
| | | |
| | | R importProduct(List<ProductExcelVO> excelVOList, BindingResult bindingResult); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.by4cloud.platformx.business.dto.AnalysisCommonDTO; |
| | | import com.by4cloud.platformx.business.dto.HomeQueryDTO; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | |
| | | public interface StatisticService { |
| | |
| | | R agingAnalysisByMarket(AnalysisCommonDTO commonDTO); |
| | | |
| | | R agingAnalysisTotalScale(AnalysisCommonDTO commonDTO); |
| | | |
| | | R homeZbjt(); |
| | | |
| | | R homeZgs(); |
| | | |
| | | R homeZbjtFlag(); |
| | | |
| | | R homeContract(HomeQueryDTO queryDTO); |
| | | |
| | | R homePaymentSlip(HomeQueryDTO queryDTO); |
| | | |
| | | R homeOutBound(HomeQueryDTO queryDTO); |
| | | |
| | | R homeInvoice(HomeQueryDTO queryDTO); |
| | | |
| | | R homeCreditSale(HomeQueryDTO queryDTO); |
| | | |
| | | R homeOverdue(HomeQueryDTO queryDTO); |
| | | |
| | | R homeOverdueHis(HomeQueryDTO queryDTO); |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.entity.BusinessCustomer; |
| | | import com.by4cloud.platformx.business.mapper.BipBanklViewMapper; |
| | | import com.by4cloud.platformx.business.mapper.BipViewMapper; |
| | | import com.by4cloud.platformx.business.mapper.BusinessCustomerMapper; |
| | | import com.by4cloud.platformx.business.service.BusinessCustomerService; |
| | | import com.by4cloud.platformx.business.vo.BankNameVo; |
| | | import com.by4cloud.platformx.business.vo.CustBankVo; |
| | | import com.by4cloud.platformx.business.vo.CustInfoVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 客商信息 |
| | | * |
| | | * @author platformx |
| | | * @date 2026-05-07 10:13:22 |
| | | */ |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class BusinessCustomerServiceImpl extends ServiceImpl<BusinessCustomerMapper, BusinessCustomer> implements BusinessCustomerService { |
| | | |
| | | private final BipViewMapper bipViewMapper; |
| | | private final BipBanklViewMapper bipBanklViewMapper; |
| | | |
| | | @Override |
| | | public R syncMainBusCus() { |
| | | List<BusinessCustomer> bcList = baseMapper.selectList(Wrappers.<BusinessCustomer>lambdaQuery().isNull(BusinessCustomer::getCreditCode) |
| | | .or().isNull(BusinessCustomer::getLegalPerson).or().isNull(BusinessCustomer::getLegalPerson) |
| | | .or().isNull(BusinessCustomer::getBankName).or().isNull(BusinessCustomer::getBankAccount) |
| | | .or().isNull(BusinessCustomer::getRegisterName)); |
| | | if (ArrayUtil.isNotEmpty(bcList.toArray())){ |
| | | for (BusinessCustomer bc:bcList |
| | | ) { |
| | | log.info("开始同步{}信息",bc.getCompanyName()); |
| | | CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCustName(bc.getCompanyName()); |
| | | if (ObjUtil.isNotNull(custInfo)){ |
| | | bc.setCreditCode(custInfo.getCertificateId()); |
| | | bc.setRegisterName(custInfo.getCustName()); |
| | | bc.setLegalPerson(custInfo.getLegalGerson()); |
| | | bc.setAddress(custInfo.getRegistrationAddress()); |
| | | baseMapper.updateById(bc); |
| | | log.info("{}同步名称、法人、地址、信用码信息成功",bc.getCompanyName()); |
| | | } |
| | | CustBankVo bankVo = bipViewMapper.selectBankByCustName(bc.getCompanyName()); |
| | | if (ObjUtil.isNotNull(bankVo)){ |
| | | if (StrUtil.isEmpty(bc.getBankAccount())){ |
| | | bc.setBankAccount(bankVo.getBankAccount()); |
| | | baseMapper.updateById(bc); |
| | | log.info("{}同步银行卡号信息成功",bc.getCompanyName()); |
| | | } |
| | | BankNameVo bankNameVo = bipBanklViewMapper.selectBankByCode(bankVo.getBankName()); |
| | | if (ObjUtil.isNotNull(bankVo)){ |
| | | bc.setBankName(bankNameVo.getBankNameName()); |
| | | baseMapper.updateById(bc); |
| | | log.info("{}同步银行名称信息成功",bc.getCompanyName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.by4cloud.platformx.admin.api.feign.RemoteDeptService; |
| | | import com.by4cloud.platformx.business.api.feign.RemoteFlowProcessService; |
| | | import com.by4cloud.platformx.business.constant.FlowNameEnum; |
| | | import com.by4cloud.platformx.business.dto.ContractInvoiceQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.GenInvoiceInfoDTO; |
| | | import com.by4cloud.platformx.business.entity.*; |
| | | import com.by4cloud.platformx.business.mapper.*; |
| | |
| | | import com.by4cloud.platformx.business.service.PaymentConfirmService; |
| | | import com.by4cloud.platformx.business.vo.*; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.mybatis.BaseModel; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import com.by4cloud.platformx.flow.task.dto.ProcessInstanceParamDto; |
| | |
| | | baseMapper.updateById(blueInvoice); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Page pageInvoice(Page page, ContractInvoiceQueryDTO queryDTO) { |
| | | return baseMapper.pageInvoice(page,queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.dto.ContractOutBoundQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.ContractOutBound; |
| | | import com.by4cloud.platformx.business.mapper.ContractOutBoundMapper; |
| | | import com.by4cloud.platformx.business.service.ContractOutBoundService; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import org.springframework.stereotype.Service; |
| | | /** |
| | | * 合同出库 |
| | |
| | | */ |
| | | @Service |
| | | public class ContractOutBoundServiceImpl extends ServiceImpl<ContractOutBoundMapper, ContractOutBound> implements ContractOutBoundService { |
| | | @Override |
| | | public Page pageScope(Page page, ContractOutBoundQueryDTO queryDTO) { |
| | | return baseMapper.pageScope(page,queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | } |
| | |
| | | Contract contract = BeanUtil.copyProperties(addDTO, Contract.class); |
| | | contract.setPartyBId(SecurityUtils.getUser().getCompId()); |
| | | contract.setPartyB(SecurityUtils.getUser().getCompName()); |
| | | if (StrUtil.isEmpty(addDTO.getPartyA())){ |
| | | BusinessCustomer bc = businessCustomerMapper.selectById(addDTO.getPartyAId()); |
| | | if (ObjUtil.isNotNull(bc)){ |
| | | contract.setPartyA(bc.getCompanyName()); |
| | | } |
| | | } |
| | | |
| | | contract.setPaidAmount(new BigDecimal("0")); |
| | | contract.setBillingStatus("0"); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.CreditSalesQueryDTO; |
| | | import com.by4cloud.platformx.business.mapper.ContractMapper; |
| | | import com.by4cloud.platformx.business.mapper.ContractOutBoundMapper; |
| | | import com.by4cloud.platformx.business.service.CreditSalesService; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @RequiredArgsConstructor |
| | | public class CreditSalesServiceImpl implements CreditSalesService { |
| | | |
| | | private final ContractMapper contractMapper; |
| | | private final ContractOutBoundMapper contractOutBoundMapper; |
| | | |
| | | @Override |
| | | public Page page(Page page, CreditSalesQueryDTO queryDTO) { |
| | | return contractMapper.pageByCredit(page, queryDTO, DataScope.of("comp_id")); |
| | | return contractOutBoundMapper.pageByCredit(page, queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.dto.CurrentOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.CurrentOverdue; |
| | | import com.by4cloud.platformx.business.mapper.CurrentOverdueMapper; |
| | | import com.by4cloud.platformx.business.service.CurrentOverdueService; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import org.springframework.stereotype.Service; |
| | | /** |
| | | * 未关闭合同(当前逾期) |
| | |
| | | public class CurrentOverdueServiceImpl extends ServiceImpl<CurrentOverdueMapper, CurrentOverdue> implements CurrentOverdueService { |
| | | |
| | | @Override |
| | | public boolean save(CurrentOverdue entity) { |
| | | return super.save(entity); |
| | | public Page pageScope(Page page, CurrentOverdueQueryDTO queryDTO) { |
| | | return baseMapper.pageScope(page,queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.dto.HistoryOverdueQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.HistoryOverdue; |
| | | import com.by4cloud.platformx.business.mapper.HistoryOverdueMapper; |
| | | import com.by4cloud.platformx.business.service.HistoryOverdueService; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import org.springframework.stereotype.Service; |
| | | /** |
| | | * 历史逾期 |
| | |
| | | */ |
| | | @Service |
| | | public class HistoryOverdueServiceImpl extends ServiceImpl<HistoryOverdueMapper, HistoryOverdue> implements HistoryOverdueService { |
| | | @Override |
| | | public Page pageScope(Page page, HistoryOverdueQueryDTO queryDTO) { |
| | | return baseMapper.pageScope(page,queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | } |
| | |
| | | if (ObjUtil.isNull(contract)) { |
| | | return R.failed("合同查询失败,请检查合同编号"); |
| | | } |
| | | BusinessCustomer customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery() |
| | | .eq(StrUtil.isNotBlank(addDTO.getBusGuestName()), BusinessCustomer::getRegisterName, addDTO.getBusGuestName()) |
| | | .eq(StrUtil.isNotBlank(addDTO.getBusGuestId()), BusinessCustomer::getId, addDTO.getBusGuestId())); |
| | | BusinessCustomer customer = businessCustomerService.getById(contract.getPartyAId()); |
| | | if (ObjUtil.isNull(customer)) { |
| | | return R.failed("客商查询失败,请检查客商"); |
| | | } |
| | |
| | | lastTotal = lastConfirm.getTotalAmount(); |
| | | } |
| | | |
| | | |
| | | //转入 |
| | | if (StrUtil.equals(addDTO.getInOrOut(), "1")) { |
| | | |
| | | |
| | | //新增付款单 |
| | | PaymentSlip slip = new PaymentSlip(); |
| | | slip.setBusGuestId(customer.getId()); |
| | | slip.setBusGuestName(customer.getRegisterName()); |
| | | slip.setPayeeCompId(SecurityUtils.getUser().getCompId()); |
| | | slip.setPaymentTime(addDTO.getConfirmTime()); |
| | | slip.setPaymentAmount(addDTO.getTransationAmount()); |
| | | slip.setPayType(addDTO.getPayType()); |
| | | paymentSlipMapper.insert(slip); |
| | | |
| | | BigDecimal newtotal = addDTO.getTransationAmount().add(lastTotal); |
| | | PaymentConfirm entity = new PaymentConfirm(); |
| | | entity.setContractId(contract.getId()); |
| | |
| | | historyOverdue.setPaymentTime(addDTO.getConfirmTime()); |
| | | historyOverdue.setCompId(schedule.getCompId()); |
| | | historyOverdueMapper.insert(historyOverdue); |
| | | //查询历史已付逾期金额 |
| | | List<HistoryOverdue> historyOverdueList = historyOverdueMapper.selectList(Wrappers.<HistoryOverdue>lambdaQuery().eq(HistoryOverdue::getScheduleId, currentOverdue.getScheduleId())); |
| | | BigDecimal hisTotal = historyOverdueList.stream().map(item -> item.getReceivableAmount()).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //更新当前逾期 |
| | | currentOverdue.setReceivableAmount(schedule.getPlannedAmount().subtract(hisTotal)); |
| | | currentOverdue.setReceivableAmount(schedule.getPlannedAmount().subtract(schedule.getActualAmount())); |
| | | currentOverdueMapper.updateById(currentOverdue); |
| | | } |
| | | break; |
| New file |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | import com.by4cloud.platformx.business.mapper.PaymentSlipMapper; |
| | | import com.by4cloud.platformx.business.service.PaymentSlipService; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PaymentSlipServiceImpl extends ServiceImpl<PaymentSlipMapper, PaymentSlip> implements PaymentSlipService { |
| | | @Override |
| | | public Page pageScope(Page page, PaymentSlipQueryDTO queryDTO) { |
| | | return baseMapper.pageScope(page,queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import cn.hutool.core.lang.tree.TreeNode; |
| | | import cn.hutool.core.lang.tree.TreeUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.admin.api.entity.SysDept; |
| | | import com.by4cloud.platformx.business.dto.ProductAddDTO; |
| | | import com.by4cloud.platformx.business.dto.ProductQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.Product; |
| | | import com.by4cloud.platformx.business.entity.TaxCode; |
| | | import com.by4cloud.platformx.business.mapper.ProductMapper; |
| | | import com.by4cloud.platformx.business.mapper.TaxCodeMapper; |
| | | import com.by4cloud.platformx.business.service.ProductService; |
| | | import com.by4cloud.platformx.business.vo.ProductExcelVO; |
| | | import com.by4cloud.platformx.business.vo.ProductSelectVo; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.excel.vo.ErrorMessage; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.BindingResult; |
| | | |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | | |
| | | /** |
| | | * 产品信息 |
| | |
| | | * @date 2026-05-07 10:17:52 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService { |
| | | |
| | | private final TaxCodeMapper taxCodeMapper; |
| | | |
| | | @Override |
| | | public List<Tree<Long>> treeList() { |
| | | List<TreeNode<Long>> collect = baseMapper |
| | |
| | | |
| | | @Override |
| | | public R getProductListByParentId(ProductQueryDTO queryDTO) { |
| | | String[] erpCodes = new String[]{"房租租赁","dianli","water"}; |
| | | String[] erpCodes = new String[]{"house_rental","electricity_bill","water_bill"}; |
| | | // MPJLambdaWrapper<Product> wrapper = new MPJLambdaWrapper<Product>() |
| | | // .selectAs("( SELECT count(1) FROM product t1 WHERE t1.parent_id = t.id )",Product::getChildNum) |
| | | // .selectAll(Product.class) |
| | |
| | | } |
| | | return R.ok(selectVos); |
| | | } |
| | | |
| | | @Override |
| | | public R saveErpProduct(List<ProductAddDTO> addDTOS) { |
| | | if (ArrayUtil.isNotEmpty(addDTOS.toArray())){ |
| | | for (ProductAddDTO addDTO:addDTOS |
| | | ) { |
| | | List<Product> classPro = baseMapper.selectListByScope(Wrappers.<Product>lambdaQuery() |
| | | .eq(StrUtil.isNotEmpty(addDTO.getErpTypeCode()),Product::getErpCode,addDTO.getErpTypeCode()) |
| | | .eq(StrUtil.isNotEmpty(addDTO.getErpTypeName()),Product::getProductName,addDTO.getErpTypeName()) |
| | | , DataScope.of("comp_id")); |
| | | if (ArrayUtil.isEmpty(classPro.toArray())){ |
| | | Product product = new Product(); |
| | | product.setProductName(addDTO.getErpTypeName()); |
| | | product.setProductType(addDTO.getSpecification()); |
| | | product.setParentId(0L); |
| | | product.setParentName("根级产品"); |
| | | product.setErpCode(addDTO.getErpTypeCode()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,addDTO.getTaxCode()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | product.setTaxClass(taxCode.getMc()); |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | | classPro.add(product); |
| | | } |
| | | Product product = new Product(); |
| | | product.setProductName(addDTO.getErpName()); |
| | | product.setProductType(addDTO.getSpecification()); |
| | | product.setParentId(classPro.get(0).getId()); |
| | | product.setParentName(classPro.get(0).getProductName()); |
| | | product.setErpCode(addDTO.getErpCode()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,addDTO.getTaxCode()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | product.setTaxClass(taxCode.getMc()); |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R importProduct(List<ProductExcelVO> excelVOList, BindingResult bindingResult) { |
| | | List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget(); |
| | | if (ArrayUtil.isNotEmpty(excelVOList.toArray())) { |
| | | List<List<ProductExcelVO>> groups = splitList(excelVOList, 5000); |
| | | groups.stream().forEach(group->{ |
| | | for (ProductExcelVO addDTO:group |
| | | ) { |
| | | Set<String> errorMsg = new HashSet<>(); |
| | | |
| | | if (StrUtil.isEmpty(addDTO.getErpTypeCode())&&StrUtil.isEmpty(addDTO.getErpTypeName())) { |
| | | errorMsg.add("产品分类信息没有"); |
| | | } |
| | | List<Product> one = this.listByScope(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, addDTO.getErpCode())); |
| | | if (ArrayUtil.isNotEmpty(one.toArray())){ |
| | | errorMsg.add("产品erp编码已存在"); |
| | | } |
| | | if (CollUtil.isEmpty(errorMsg)){ |
| | | List<Product> classPro = baseMapper.selectListByScope(Wrappers.<Product>lambdaQuery() |
| | | .eq(StrUtil.isNotEmpty(addDTO.getErpTypeCode()),Product::getErpCode,addDTO.getErpTypeCode()) |
| | | .eq(StrUtil.isNotEmpty(addDTO.getErpTypeName()),Product::getProductName,addDTO.getErpTypeName()) |
| | | , DataScope.of("comp_id")); |
| | | if (ArrayUtil.isEmpty(classPro.toArray())){ |
| | | Product product = new Product(); |
| | | product.setProductName(addDTO.getErpTypeName()); |
| | | product.setProductType(addDTO.getSpecification()); |
| | | product.setParentId(0L); |
| | | product.setParentName("根级产品"); |
| | | product.setErpCode(addDTO.getErpTypeCode()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,addDTO.getTaxCode()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | product.setTaxClass(taxCode.getMc()); |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | | classPro.add(product); |
| | | } |
| | | Product product = new Product(); |
| | | product.setProductName(addDTO.getErpName()); |
| | | product.setProductType(addDTO.getSpecification()); |
| | | product.setParentId(classPro.get(0).getId()); |
| | | product.setParentName(classPro.get(0).getProductName()); |
| | | product.setErpCode(addDTO.getErpCode()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,addDTO.getTaxCode()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | product.setTaxClass(taxCode.getMc()); |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | if (CollUtil.isNotEmpty(errorMessageList)) { |
| | | return R.failed(errorMessageList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | public static <T> List<List<T>> splitList(List<T> list, int batchSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | int totalSize = list.size(); |
| | | // 计算需要分成多少组 |
| | | int batchCount = (totalSize + batchSize - 1) / batchSize; |
| | | |
| | | return IntStream.range(0, batchCount) |
| | | .mapToObj(i -> list.subList(i * batchSize, |
| | | Math.min((i + 1) * batchSize, totalSize))) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.by4cloud.platformx.admin.api.entity.SysDept; |
| | | import com.by4cloud.platformx.admin.api.entity.SysDictItem; |
| | | import com.by4cloud.platformx.admin.api.feign.RemoteDeptService; |
| | | import com.by4cloud.platformx.admin.api.feign.RemoteDictService; |
| | | import com.by4cloud.platformx.business.dto.AgingQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.AnalysisCommonDTO; |
| | | import com.by4cloud.platformx.business.entity.BusinessCustomer; |
| | | import com.by4cloud.platformx.business.mapper.BusinessCustomerMapper; |
| | | import com.by4cloud.platformx.business.mapper.ContractMapper; |
| | | import com.by4cloud.platformx.business.mapper.ContractPaymentScheduleMapper; |
| | | import com.by4cloud.platformx.business.dto.HomeQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.*; |
| | | import com.by4cloud.platformx.business.mapper.*; |
| | | import com.by4cloud.platformx.business.service.StatisticService; |
| | | import com.by4cloud.platformx.business.vo.*; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | private final ContractMapper contractMapper; |
| | | private final ContractPaymentScheduleMapper contractPaymentScheduleMapper; |
| | | private final BusinessCustomerMapper businessCustomerMapper; |
| | | private final PaymentSlipMapper paymentSlipMapper; |
| | | private final ContractOutBoundMapper contractOutBoundMapper; |
| | | private final ContractInvoiceMapper contractInvoiceMapper; |
| | | private final CurrentOverdueMapper currentOverdueMapper; |
| | | private final HistoryOverdueMapper historyOverdueMapper; |
| | | private final RemoteDeptService remoteDeptService; |
| | | private final RemoteDictService remoteDictService; |
| | | |
| | |
| | | result.add(agingAnalysisVo); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @Override |
| | | public R homeZbjt() { |
| | | List<HomeZbjtVo> homeZbjtVoList = new ArrayList<>(); |
| | | //合同签订 sgb smj jxc tfgs ymj |
| | | HomeZbjtVo htqd = contractMapper.homeZbjt(); |
| | | homeZbjtVoList.add(htqd); |
| | | //回款 |
| | | HomeZbjtVo hk = paymentSlipMapper.homeZbjt(); |
| | | homeZbjtVoList.add(hk); |
| | | //出货 |
| | | HomeZbjtVo ch = contractOutBoundMapper.homeZbjt(); |
| | | homeZbjtVoList.add(ch); |
| | | //开票 |
| | | HomeZbjtVo kp = contractInvoiceMapper.homeZbjt(); |
| | | homeZbjtVoList.add(kp); |
| | | //赊销产生值 今天发货加今天开票额 |
| | | // if (ObjUtil.isNotNull(ch)&&ObjUtil.isNotNull(kp)){ |
| | | // HomeZbjtVo sxsy = ch.add(kp); |
| | | // homeZbjtVoList.add(sxsy); |
| | | // }else if (ObjUtil.isNotNull(ch)&&ObjUtil.isNull(kp)){ |
| | | homeZbjtVoList.add(ch); |
| | | // }else if (ObjUtil.isNull(ch)&&ObjUtil.isNotNull(kp)){ |
| | | // homeZbjtVoList.add(kp); |
| | | // }else { |
| | | // homeZbjtVoList.add(new HomeZbjtVo()); |
| | | // } |
| | | //赊销累计剩余值 今日发货且没开票的出货 |
| | | HomeZbjtVo sx = contractOutBoundMapper.homeZbjtSX(); |
| | | homeZbjtVoList.add(sx); |
| | | HomeZbjtVo yq = currentOverdueMapper.homeZbjt(); |
| | | //逾期累计剩余 今日产生逾期 含历史 |
| | | HomeZbjtVo ls = historyOverdueMapper.homeZbjt(); |
| | | if (ObjUtil.isNotNull(ls)&&ObjUtil.isNotNull(yq)){ |
| | | homeZbjtVoList.add(yq.add(ls)); |
| | | }else if (ObjUtil.isNotNull(ls)&&ObjUtil.isNull(yq)){ |
| | | homeZbjtVoList.add(ls); |
| | | }else if (ObjUtil.isNull(ls)&&ObjUtil.isNotNull(yq)){ |
| | | homeZbjtVoList.add(yq); |
| | | }else { |
| | | homeZbjtVoList.add(new HomeZbjtVo()); |
| | | } |
| | | //逾期产生值 今天产生-今天已付 |
| | | |
| | | homeZbjtVoList.add(yq); |
| | | return R.ok(homeZbjtVoList); |
| | | } |
| | | |
| | | @Override |
| | | public R homeZgs() { |
| | | List<HomeZgsVo> homeZbjtVoList = new ArrayList<>(); |
| | | //合同签订 华北 西北 东北 海外 |
| | | HomeZgsVo htqd = contractMapper.homeZgs(SecurityUtils.getUser().getCompId()); |
| | | homeZbjtVoList.add(htqd); |
| | | //回款 |
| | | HomeZgsVo hk = paymentSlipMapper.homeZgs(SecurityUtils.getUser().getCompId()); |
| | | homeZbjtVoList.add(hk); |
| | | //出货 |
| | | HomeZgsVo ch = contractOutBoundMapper.homeZgs(SecurityUtils.getUser().getCompId()); |
| | | homeZbjtVoList.add(ch); |
| | | //开票 |
| | | HomeZgsVo kp = contractInvoiceMapper.homeZgs(SecurityUtils.getUser().getCompId()); |
| | | homeZbjtVoList.add(kp); |
| | | //赊销产生值 |
| | | // if (ObjUtil.isNotNull(ch)&&ObjUtil.isNotNull(kp)){ |
| | | // HomeZgsVo sxsy = ch.add(kp); |
| | | // homeZbjtVoList.add(sxsy); |
| | | // }else if (ObjUtil.isNotNull(ch)&&ObjUtil.isNull(kp)){ |
| | | homeZbjtVoList.add(ch); |
| | | // }else if (ObjUtil.isNull(ch)&&ObjUtil.isNotNull(kp)){ |
| | | // homeZbjtVoList.add(kp); |
| | | // }else { |
| | | // homeZbjtVoList.add(new HomeZgsVo()); |
| | | // } |
| | | //赊销累计剩余值 |
| | | HomeZgsVo sx = contractOutBoundMapper.homeZgsSX(SecurityUtils.getUser().getCompId()); |
| | | homeZbjtVoList.add(sx); |
| | | |
| | | HomeZgsVo yq = currentOverdueMapper.homeZgs(SecurityUtils.getUser().getCompId()); |
| | | |
| | | //逾期产生值 |
| | | HomeZgsVo ls = historyOverdueMapper.homeZgs(SecurityUtils.getUser().getCompId()); |
| | | if (ObjUtil.isNotNull(ls)&&ObjUtil.isNotNull(yq)){ |
| | | homeZbjtVoList.add(yq.add(ls)); |
| | | }else if (ObjUtil.isNotNull(ls)&&ObjUtil.isNull(yq)){ |
| | | homeZbjtVoList.add(ls); |
| | | }else if (ObjUtil.isNull(ls)&&ObjUtil.isNotNull(yq)){ |
| | | homeZbjtVoList.add(yq); |
| | | }else { |
| | | homeZbjtVoList.add(new HomeZgsVo()); |
| | | } |
| | | //逾期累计剩余 |
| | | homeZbjtVoList.add(yq); |
| | | return R.ok(homeZbjtVoList); |
| | | } |
| | | |
| | | @Override |
| | | public R homeZbjtFlag() { |
| | | Long userId = SecurityUtils.getUser().getCompId(); |
| | | List<Long> compIds = new ArrayList<>(); |
| | | compIds.add(Long.valueOf(sgb)); |
| | | compIds.add(Long.valueOf(smj)); |
| | | compIds.add(Long.valueOf(tfgs)); |
| | | compIds.add(Long.valueOf(ymj)); |
| | | compIds.add(Long.valueOf(jxc)); |
| | | if (compIds.contains(userId)){ |
| | | return R.ok(false); |
| | | }; |
| | | return R.ok(true); |
| | | } |
| | | |
| | | @Override |
| | | public R homeContract(HomeQueryDTO queryDTO) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate today = now.toLocalDate(); |
| | | // 开始时间:今天 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // 结束时间:今天 23:59:59.999999999 (或者使用 nextDay 00:00:00 配合 lt) |
| | | LocalDateTime endOfDay = today.atTime(LocalTime.MAX); |
| | | // --- 场景二:查询当月数据 --- |
| | | // 开始时间:当月1号 00:00:00 |
| | | LocalDateTime startOfMonth = today.withDayOfMonth(1).atStartOfDay(); |
| | | // 结束时间:当月最后一天 23:59:59 |
| | | LocalDateTime endOfMonth = today.withDayOfMonth(today.lengthOfMonth()).atTime(LocalTime.MAX); |
| | | |
| | | // 开始时间:当年1月1号 00:00:00 |
| | | LocalDateTime startOfYear = today.withDayOfYear(1).atStartOfDay(); |
| | | // 结束时间:当年12月31号 23:59:59 |
| | | LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX); |
| | | |
| | | MPJLambdaWrapper<Contract> wrapper = new MPJLambdaWrapper<Contract>() |
| | | .selectAll(Contract.class) |
| | | .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,Contract::getPartyAId) |
| | | .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId()) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),Contract::getSignDate,startOfDay) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),Contract::getSignDate,endOfDay) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),Contract::getSignDate,startOfMonth) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),Contract::getSignDate,endOfMonth) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),Contract::getSignDate,startOfYear) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),Contract::getSignDate,endOfYear) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea()) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr()) |
| | | .orderByDesc(Contract::getCreateTime) |
| | | ; |
| | | return R.ok(contractMapper.selectList(wrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public R homePaymentSlip(HomeQueryDTO queryDTO) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate today = now.toLocalDate(); |
| | | // 开始时间:今天 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // 结束时间:今天 23:59:59.999999999 (或者使用 nextDay 00:00:00 配合 lt) |
| | | LocalDateTime endOfDay = today.atTime(LocalTime.MAX); |
| | | // --- 场景二:查询当月数据 --- |
| | | // 开始时间:当月1号 00:00:00 |
| | | LocalDateTime startOfMonth = today.withDayOfMonth(1).atStartOfDay(); |
| | | // 结束时间:当月最后一天 23:59:59 |
| | | LocalDateTime endOfMonth = today.withDayOfMonth(today.lengthOfMonth()).atTime(LocalTime.MAX); |
| | | |
| | | // 开始时间:当年1月1号 00:00:00 |
| | | LocalDateTime startOfYear = today.withDayOfYear(1).atStartOfDay(); |
| | | // 结束时间:当年12月31号 23:59:59 |
| | | LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX); |
| | | MPJLambdaWrapper<PaymentSlip> wrapper = new MPJLambdaWrapper<PaymentSlip>() |
| | | .selectAll(PaymentSlip.class) |
| | | .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,PaymentSlip::getBusGuestId) |
| | | .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId()) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),PaymentSlip::getPaymentTime,startOfDay) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),PaymentSlip::getPaymentTime,endOfDay) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),PaymentSlip::getPaymentTime,startOfMonth) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),PaymentSlip::getPaymentTime,endOfMonth) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),PaymentSlip::getPaymentTime,startOfYear) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),PaymentSlip::getPaymentTime,endOfYear) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea()) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr()) |
| | | .orderByDesc(PaymentSlip::getCreateTime) |
| | | ; |
| | | return R.ok(paymentSlipMapper.selectList(wrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public R homeOutBound(HomeQueryDTO queryDTO) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate today = now.toLocalDate(); |
| | | // 开始时间:今天 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // 结束时间:今天 23:59:59.999999999 (或者使用 nextDay 00:00:00 配合 lt) |
| | | LocalDateTime endOfDay = today.atTime(LocalTime.MAX); |
| | | // --- 场景二:查询当月数据 --- |
| | | // 开始时间:当月1号 00:00:00 |
| | | LocalDateTime startOfMonth = today.withDayOfMonth(1).atStartOfDay(); |
| | | // 结束时间:当月最后一天 23:59:59 |
| | | LocalDateTime endOfMonth = today.withDayOfMonth(today.lengthOfMonth()).atTime(LocalTime.MAX); |
| | | |
| | | // 开始时间:当年1月1号 00:00:00 |
| | | LocalDateTime startOfYear = today.withDayOfYear(1).atStartOfDay(); |
| | | // 结束时间:当年12月31号 23:59:59 |
| | | LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX); |
| | | MPJLambdaWrapper<ContractOutBound> wrapper = new MPJLambdaWrapper<ContractOutBound>() |
| | | .selectAll(ContractOutBound.class) |
| | | .select(Contract::getContractNo) |
| | | .selectAs(BusinessCustomer::getCompanyName,"busGuestName") |
| | | .select(ContractSubjectMatter::getUnitPrice) |
| | | .leftJoin(Contract.class,Contract::getId,ContractOutBound::getContractId) |
| | | .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,ContractOutBound::getBusGuestId) |
| | | .leftJoin(ContractSubjectMatter.class, on-> |
| | | on.eq(ContractSubjectMatter::getContractId,ContractOutBound::getContractId) |
| | | .eq(ContractSubjectMatter::getMaterialCode,ContractOutBound::getSubjectMatterCode) |
| | | ) |
| | | .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId()) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,startOfDay) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,endOfDay) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,startOfMonth) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,endOfMonth) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,startOfYear) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,endOfYear) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea()) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr()) |
| | | .orderByDesc(ContractOutBound::getCreateTime) |
| | | ; |
| | | return R.ok(contractOutBoundMapper.selectJoinList(HomeOutBoundVo.class,wrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public R homeInvoice(HomeQueryDTO queryDTO) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate today = now.toLocalDate(); |
| | | // 开始时间:今天 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // 结束时间:今天 23:59:59.999999999 (或者使用 nextDay 00:00:00 配合 lt) |
| | | LocalDateTime endOfDay = today.atTime(LocalTime.MAX); |
| | | // --- 场景二:查询当月数据 --- |
| | | // 开始时间:当月1号 00:00:00 |
| | | LocalDateTime startOfMonth = today.withDayOfMonth(1).atStartOfDay(); |
| | | // 结束时间:当月最后一天 23:59:59 |
| | | LocalDateTime endOfMonth = today.withDayOfMonth(today.lengthOfMonth()).atTime(LocalTime.MAX); |
| | | |
| | | // 开始时间:当年1月1号 00:00:00 |
| | | LocalDateTime startOfYear = today.withDayOfYear(1).atStartOfDay(); |
| | | // 结束时间:当年12月31号 23:59:59 |
| | | LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX); |
| | | MPJLambdaWrapper<ContractInvoice> wrapper = new MPJLambdaWrapper<ContractInvoice>() |
| | | .selectAll(ContractInvoice.class) |
| | | .select(Contract::getContractNo) |
| | | .selectAs(BusinessCustomer::getCompanyName,"busGuestName") |
| | | .leftJoin(Contract.class,Contract::getId,ContractInvoice::getContractId) |
| | | .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,Contract::getPartyAId) |
| | | .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId()) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractInvoice::getInvoiceTime,startOfDay) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractInvoice::getInvoiceTime,endOfDay) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractInvoice::getInvoiceTime,startOfMonth) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractInvoice::getInvoiceTime,endOfMonth) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractInvoice::getInvoiceTime,startOfYear) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractInvoice::getInvoiceTime,endOfYear) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea()) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr()) |
| | | .orderByDesc(ContractInvoice::getCreateTime) |
| | | ; |
| | | return R.ok(contractInvoiceMapper.selectJoinList(HomeInvoiceVo.class,wrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public R homeCreditSale(HomeQueryDTO queryDTO) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate today = now.toLocalDate(); |
| | | // 开始时间:今天 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // 结束时间:今天 23:59:59.999999999 (或者使用 nextDay 00:00:00 配合 lt) |
| | | LocalDateTime endOfDay = today.atTime(LocalTime.MAX); |
| | | // --- 场景二:查询当月数据 --- |
| | | // 开始时间:当月1号 00:00:00 |
| | | LocalDateTime startOfMonth = today.withDayOfMonth(1).atStartOfDay(); |
| | | // 结束时间:当月最后一天 23:59:59 |
| | | LocalDateTime endOfMonth = today.withDayOfMonth(today.lengthOfMonth()).atTime(LocalTime.MAX); |
| | | |
| | | // 开始时间:当年1月1号 00:00:00 |
| | | LocalDateTime startOfYear = today.withDayOfYear(1).atStartOfDay(); |
| | | // 结束时间:当年12月31号 23:59:59 |
| | | LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX); |
| | | MPJLambdaWrapper<ContractOutBound> wrapper = new MPJLambdaWrapper<ContractOutBound>() |
| | | .selectAll(ContractOutBound.class) |
| | | .select(Contract::getContractNo) |
| | | .selectAs(BusinessCustomer::getCompanyName,"busGuestName") |
| | | .select(ContractSubjectMatter::getUnitPrice) |
| | | .leftJoin(Contract.class,Contract::getId,ContractOutBound::getContractId) |
| | | .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,Contract::getPartyAId) |
| | | .leftJoin(ContractSubjectMatter.class, on-> |
| | | on.eq(ContractSubjectMatter::getContractId,ContractOutBound::getContractId) |
| | | .eq(ContractSubjectMatter::getMaterialCode,ContractOutBound::getSubjectMatterCode) |
| | | ) |
| | | .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId()) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,startOfDay) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,endOfDay) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,startOfMonth) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,endOfMonth) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,startOfYear) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,endOfYear) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea()) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr()) |
| | | .orderByDesc(ContractOutBound::getCreateTime) |
| | | ; |
| | | return R.ok(contractOutBoundMapper.selectJoinList(HomeCreditSaleVo.class,wrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public R homeOverdue(HomeQueryDTO queryDTO) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate today = now.toLocalDate(); |
| | | // 开始时间:今天 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // 结束时间:今天 23:59:59.999999999 (或者使用 nextDay 00:00:00 配合 lt) |
| | | LocalDateTime endOfDay = today.atTime(LocalTime.MAX); |
| | | // --- 场景二:查询当月数据 --- |
| | | // 开始时间:当月1号 00:00:00 |
| | | LocalDateTime startOfMonth = today.withDayOfMonth(1).atStartOfDay(); |
| | | // 结束时间:当月最后一天 23:59:59 |
| | | LocalDateTime endOfMonth = today.withDayOfMonth(today.lengthOfMonth()).atTime(LocalTime.MAX); |
| | | |
| | | // 开始时间:当年1月1号 00:00:00 |
| | | LocalDateTime startOfYear = today.withDayOfYear(1).atStartOfDay(); |
| | | // 结束时间:当年12月31号 23:59:59 |
| | | LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX); |
| | | MPJLambdaWrapper<CurrentOverdue> wrapper = new MPJLambdaWrapper<CurrentOverdue>() |
| | | .selectAll(CurrentOverdue.class) |
| | | .select(Contract::getContractNo) |
| | | .selectAs(BusinessCustomer::getCompanyName,"busGuestName") |
| | | .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,CurrentOverdue::getBusGuestId) |
| | | .leftJoin(Contract.class,Contract::getId,CurrentOverdue::getContractId) |
| | | .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId()) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),CurrentOverdue::getContractExpirTime,startOfDay) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),CurrentOverdue::getContractExpirTime,endOfDay) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),CurrentOverdue::getContractExpirTime,startOfMonth) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),CurrentOverdue::getContractExpirTime,endOfMonth) |
| | | .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),CurrentOverdue::getContractExpirTime,startOfYear) |
| | | .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),CurrentOverdue::getContractExpirTime,endOfYear) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea()) |
| | | .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr()) |
| | | .orderByDesc(CurrentOverdue::getCreateTime) |
| | | ; |
| | | return R.ok(currentOverdueMapper.selectJoinList(HomeOverdueVo.class,wrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public R homeOverdueHis(HomeQueryDTO queryDTO) { |
| | | List<HomeOverdueStaVo> homeOverdueVos = new ArrayList<>(); |
| | | HomeOverdueStaVo current = currentOverdueMapper.selectCurrentOverdue(queryDTO); |
| | | if (ObjUtil.isNotNull(current)){ |
| | | current.setOverdueType("当前"); |
| | | homeOverdueVos.add(current); |
| | | } |
| | | HomeOverdueStaVo history = historyOverdueMapper.selectHistoryOverdue(queryDTO); |
| | | if (ObjUtil.isNotNull(history)){ |
| | | history.setOverdueType("历史"); |
| | | homeOverdueVos.add(history); |
| | | } |
| | | return R.ok(homeOverdueVos); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | // System.out.println(encrypt("123456","pigxpigxpigxpigx")); |
| | | // System.out.println(encrypt("admin12!@","pigxpigxpigxpigx")); |
| | | // 或者自定义 WorkerId 和 DataCenterId |
| | | Snowflake snowflake = IdUtil.createSnowflake(1, 1); |
| | | for (int i = 0; i < 1150; i++) { |
| | | for (int i = 0; i < 13; i++) { |
| | | System.out.println(snowflake.nextId()); |
| | | } |
| | | } |
| | |
| | | <id property="id" column="id"/> |
| | | <result property="compId" column="comp_id"/> |
| | | <result property="contractId" column="contract_id"/> |
| | | <result property="invoicePrice" column="invoice_price"/> |
| | | <result property="invoicePrice" column="invoice_total_price_tax"/> |
| | | <result property="invoiceTime" column="invoice_time"/> |
| | | <result property="invoicePath" column="invoice_path"/> |
| | | <result property="invoiceCategory" column="invoice_category"/> |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | <select id="homeZbjt" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum(ci.invoice_total_price_tax) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZgs" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '6' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '6' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '1' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '1' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '1' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '3' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '3' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '3' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '4' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '4' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '4' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '5' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '5' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '5' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.export_service_attr = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.export_service_attr = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum( ci.invoice_total_price_tax ) |
| | | FROM |
| | | contract_invoice ci, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND ci.contract_id = c.id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND ci.comp_id = #{compId} |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | <select id="pageInvoice" resultType="com.by4cloud.platformx.business.vo.HomeInvoiceVo"> |
| | | SELECT |
| | | t.id, |
| | | t.contract_id, |
| | | t.invoice_category, |
| | | t.invoice_total_price, |
| | | t.invoice_total_tax, |
| | | t.invoice_total_price_tax, |
| | | t.invoice_time, |
| | | t.invoice_status, |
| | | t.invoice_path, |
| | | t.out_bound_id, |
| | | t.invoice_preview_param, |
| | | t.red_reversal, |
| | | t.invoice_no, |
| | | t.serial_no, |
| | | t.tex_no, |
| | | t.seller_tax_name, |
| | | t.buyer_tax_name, |
| | | t.invoice_preview, |
| | | t.approval_status, |
| | | t.blue_invoice_id, |
| | | t.bip_push, |
| | | t.bip_id, |
| | | t.bip_body, |
| | | t.create_by, |
| | | t.update_by, |
| | | t.create_time, |
| | | t.update_time, |
| | | t.del_flag, |
| | | t.comp_id, |
| | | t1.contract_no, |
| | | t2.company_name AS busGuestName, |
| | | t1.partyB |
| | | FROM |
| | | contract_invoice t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t1.party_a_id AND t2.del_flag = '0' ) |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.invoiceCategory !=null and queryDTO.invoiceCategory !=''"> |
| | | AND t.invoice_category = #{queryDTO.invoiceCategory} |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND t1.contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> |
| | | AND t2.company_name LIKE CONCAT('%', #{queryDTO.partyA}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.invoice_time >= CURDATE() |
| | | AND t.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.invoice_time >= #{queryDTO.startTime} |
| | | AND t.invoice_time <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | ) - IFNULL( t.billing_amout, 0 )) creditAmount |
| | | FROM |
| | | contract t |
| | | LEFT JOIN business_customer t1 ON ( t1.id = t.bus_guest_id AND t1.del_flag = '0' ) |
| | | WHERE |
| | | ( |
| | | IFNULL( t.billing_amout, 0 )<( |
| | |
| | | </if> |
| | | <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> |
| | | and t.party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t1.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t1.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.payment_time >= CURDATE() |
| | | AND t.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.payment_time >= #{queryDTO.startTime} |
| | | AND t.payment_time <= #{queryDTO.endTime} |
| | | </if> |
| | | <if test="queryDTO.productNames !=null and queryDTO.productNames !=''"> |
| | | and (SELECT GROUP_CONCAT(DISTINCT t1.material_internal_name) from contract_subject_matter t1 WHERE t1.contract_id = t.id) LIKE CONCAT('%', #{queryDTO.productNames}, '%') |
| | |
| | | </select> |
| | | <select id="pageScope" resultType="com.by4cloud.platformx.business.vo.ContractPageVo"> |
| | | SELECT |
| | | id, |
| | | contract_no, |
| | | contract_name, |
| | | party_a_id, |
| | | party_a, |
| | | party_b_id, |
| | | party_b, |
| | | amount, |
| | | currency, |
| | | contract_type, |
| | | supply_attribute, |
| | | contract_status, |
| | | contract_attribute, |
| | | sign_date, |
| | | sign_place, |
| | | effective_date, |
| | | delivery_cycle, |
| | | expiration_date, |
| | | attachment_url, |
| | | remark, |
| | | parent_id, |
| | | approve_time, |
| | | arrival_schedule_id, |
| | | accept_schedule_id, |
| | | erp_push_flag, |
| | | billing_status, |
| | | billing_amout, |
| | | next_schedule_name, |
| | | template_id, |
| | | sales_model, |
| | | paid_amount, |
| | | contract_category, |
| | | exec_frequency, |
| | | exec_times, |
| | | exec_day, |
| | | environment, |
| | | standard, |
| | | use_month, |
| | | after_ship_month, |
| | | ship_method, |
| | | ship_address, |
| | | packaging, |
| | | repair_period, |
| | | repair_breach_amount, |
| | | goods_short, |
| | | goods_short_breach_amount, |
| | | overdue_breach_amount, |
| | | terminate_contract, |
| | | court, |
| | | contract_attchment, |
| | | city, |
| | | region, |
| | | invoice_notice, |
| | | contract_tax, |
| | | create_by, |
| | | update_by, |
| | | create_time, |
| | | update_time, |
| | | del_flag, |
| | | comp_id, |
| | | c.id, |
| | | c.contract_no, |
| | | c.contract_name, |
| | | c.party_a_id, |
| | | c.party_a, |
| | | c.party_b_id, |
| | | c.party_b, |
| | | c.amount, |
| | | c.contract_type, |
| | | c.supply_attribute, |
| | | c.contract_status, |
| | | c.contract_attribute, |
| | | c.sign_date, |
| | | c.sign_place, |
| | | c.effective_date, |
| | | c.delivery_cycle, |
| | | c.expiration_date, |
| | | c.attachment_url, |
| | | c.remark, |
| | | c.parent_id, |
| | | c.approve_time, |
| | | c.arrival_schedule_id, |
| | | c.accept_schedule_id, |
| | | c.billing_status, |
| | | c.billing_amout, |
| | | c.template_id, |
| | | c.sales_model, |
| | | c.paid_amount, |
| | | c.contract_category, |
| | | c.exec_frequency, |
| | | c.comp_id, |
| | | (select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = c.id) outAmount |
| | | FROM |
| | | contract c |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | del_flag = '0' |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | <if test="queryDTO.contractName !=null and queryDTO.contractName !=''"> |
| | | AND contract_name LIKE CONCAT('%', #{queryDTO.contractName}, '%') |
| | | </if> |
| | |
| | | <if test="queryDTO.contractStatus !=null and queryDTO.contractStatus !=''"> |
| | | AND contract_status = #{queryDTO.contractStatus} |
| | | </if> |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND c.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND bc.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND bc.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND c.sign_date >= #{queryDTO.startTime} |
| | | AND c.sign_date <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | create_time DESC |
| | | c.create_time DESC |
| | | </select> |
| | | <select id="homeZbjt" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >=CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >=CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >=CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum( c.amount ) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZgs" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '6' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '6' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '6' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '1' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '1' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '1' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '5' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '5' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '5' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '4' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '4' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '4' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '3' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '3' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '3' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.export_service_attr = '2' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.export_service_attr = '2' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum(c.amount) |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | AND bc.export_service_attr = '2' |
| | | AND c.comp_id = #{compId} |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | <select id="homeZbjt" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556196124250113 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556196124250113 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556196124250113 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056555602756063234 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056555602756063234 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056555602756063234 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556317461270529 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556317461270529 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556317461270529 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556421857497090 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556421857497090 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556421857497090 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556535640576002 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556535640576002 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556535640576002 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZbjtSX" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | SUM( |
| | | csm.unit_price * ( cob.out_bound_num - cob.invoice_num )) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556196124250113 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556196124250113 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556196124250113 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056555602756063234 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056555602756063234 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056555602756063234 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556317461270529 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556317461270529 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556317461270529 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556421857497090 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556421857497090 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556421857497090 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556535640576002 |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556535640576002 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND csm.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = 2056556535640576002 |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZgs" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '6' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '6' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '6' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '1' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '1' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '1' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '3' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '3' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '3' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '4' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '4' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '4' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '5' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '5' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '5' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.export_service_attr = '2' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.export_service_attr = '2' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * cob.out_bound_num ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.export_service_attr = '2' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | <select id="homeZgsSX" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND bc.area_id = '2' |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '6' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '6' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '6' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '1' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '1' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num )) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '1' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '3' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '3' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num )) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '3' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '4' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '4' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num )) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '4' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '5' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '5' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num )) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.area_id = '5' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.export_service_attr = '2' |
| | | AND cob.comp_id = #{compId} |
| | | <!-- AND cob.out_bound_time >= CURDATE() --> |
| | | AND cob.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.export_service_attr = '2' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum( csm.unit_price * ( cob.out_bound_num - cob.invoice_num ) ) |
| | | FROM |
| | | contract_out_bound cob, |
| | | contract_subject_matter csm, |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | cob.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND c.del_flag = '0' |
| | | AND cob.contract_id = csm.contract_id |
| | | AND bc.id = c.party_a_id |
| | | AND cob.subject_matter_code = csm.material_code |
| | | AND bc.export_service_attr = '2' |
| | | AND cob.comp_id = #{compId} |
| | | AND cob.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND cob.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | <select id="pageScope" resultType="com.by4cloud.platformx.business.vo.HomeOutBoundVo"> |
| | | SELECT |
| | | t.id, |
| | | t.out_bound_id, |
| | | t.contract_id, |
| | | t.contract_name, |
| | | t.bus_guest_name, |
| | | t.bus_guest_id, |
| | | t.subject_matter_name, |
| | | t.subject_matter_code, |
| | | t.out_bound_num, |
| | | t.out_bound_time, |
| | | t.out_bound_att_names, |
| | | t.out_bound_att_paths, |
| | | t.arrival_time, |
| | | t.arrival_att_names, |
| | | t.arrival_att_paths, |
| | | t.invoice_status, |
| | | t.invoice_num, |
| | | t.create_by, |
| | | t.update_by, |
| | | t.create_time, |
| | | t.update_time, |
| | | t.del_flag, |
| | | t.comp_id, |
| | | t1.contract_no, |
| | | t2.company_name AS busGuestName, |
| | | t3.unit_price |
| | | FROM |
| | | contract_out_bound t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t.bus_guest_id AND t2.del_flag = '0' ) |
| | | LEFT JOIN contract_subject_matter t3 ON t3.contract_id = t.contract_id |
| | | AND t3.material_code = t.subject_matter_code |
| | | AND t3.del_flag = '0' |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND t1.contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.busGuestName !=null and queryDTO.busGuestName !=''"> |
| | | AND t2.company_name LIKE CONCAT('%', #{queryDTO.busGuestName}, '%') |
| | | </if> |
| | | <if test="queryDTO.subjectMatterCode !=null and queryDTO.subjectMatterCode !=''"> |
| | | AND t2.subject_matter_code LIKE CONCAT('%', #{queryDTO.subjectMatterCode}, '%') |
| | | </if> |
| | | <if test="queryDTO.subjectMatterName !=null and queryDTO.subjectMatterName !=''"> |
| | | AND t.subject_matter_name LIKE CONCAT('%', #{queryDTO.subjectMatterName}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.out_bound_time >= CURDATE() |
| | | AND t.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.out_bound_time >= #{queryDTO.startTime} |
| | | AND t.out_bound_time <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | <select id="pageByCredit" resultType="com.by4cloud.platformx.business.vo.HomeOutBoundVo"> |
| | | SELECT |
| | | t.id, |
| | | t.out_bound_id, |
| | | t.contract_id, |
| | | t.contract_name, |
| | | t.bus_guest_name, |
| | | t.bus_guest_id, |
| | | t.subject_matter_name, |
| | | t.subject_matter_code, |
| | | t.out_bound_num, |
| | | t.out_bound_time, |
| | | t.out_bound_att_names, |
| | | t.out_bound_att_paths, |
| | | t.arrival_time, |
| | | t.arrival_att_names, |
| | | t.arrival_att_paths, |
| | | t.invoice_status, |
| | | t.invoice_num, |
| | | t.create_by, |
| | | t.update_by, |
| | | t.create_time, |
| | | t.update_time, |
| | | t.del_flag, |
| | | t.comp_id, |
| | | t1.contract_no, |
| | | t2.company_name AS busGuestName, |
| | | t3.unit_price |
| | | FROM |
| | | contract_out_bound t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t.bus_guest_id AND t2.del_flag = '0' ) |
| | | LEFT JOIN contract_subject_matter t3 ON t3.contract_id = t.contract_id |
| | | AND t3.material_code = t.subject_matter_code |
| | | AND t3.del_flag = '0' |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND t1.contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.busGuestName !=null and queryDTO.busGuestName !=''"> |
| | | AND t2.company_name LIKE CONCAT('%', #{queryDTO.busGuestName}, '%') |
| | | </if> |
| | | <if test="queryDTO.subjectMatterCode !=null and queryDTO.subjectMatterCode !=''"> |
| | | AND t2.subject_matter_code LIKE CONCAT('%', #{queryDTO.subjectMatterCode}, '%') |
| | | </if> |
| | | <if test="queryDTO.subjectMatterName !=null and queryDTO.subjectMatterName !=''"> |
| | | AND t.subject_matter_name LIKE CONCAT('%', #{queryDTO.subjectMatterName}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.out_bound_time >= CURDATE() |
| | | AND t.out_bound_time < DATE_ADD( CURDATE(), INTERVAL -6 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.out_bound_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.out_bound_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.out_bound_time >= #{queryDTO.startTime} |
| | | AND t.out_bound_time <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="compId" column="comp_id"/> |
| | | <result property="busGuestId" column="bus_guest_id"/> |
| | | <result property="busGuestName" column="bus_guest_name"/> |
| | | <result property="contractExpirTime" column="contract_expir_time"/> |
| | | <result property="contractExpirTime" column="create_time"/> |
| | | <result property="contractId" column="contract_id"/> |
| | | <result property="contractName" column="contract_name"/> |
| | | <result property="overdueDuration" column="overdue_duration"/> |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | <select id="homeZbjt" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | current_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZgs" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | current_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | <select id="pageScope" resultType="com.by4cloud.platformx.business.vo.HomeOverdueVo"> |
| | | SELECT |
| | | t.id, |
| | | t.bus_guest_name, |
| | | t.bus_guest_id, |
| | | t.contract_name, |
| | | t.contract_id, |
| | | t.receivable_amount, |
| | | t.schedule_id, |
| | | t.schedule_name, |
| | | t.contract_expir_time, |
| | | t.overdue_duration, |
| | | t1.contract_no, |
| | | t.comp_id |
| | | FROM |
| | | current_overdue t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t.bus_guest_id AND t2.del_flag = '0' ) |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND t1.contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.busGuestName !=null and queryDTO.busGuestName !=''"> |
| | | AND t2.company_name LIKE CONCAT('%', #{queryDTO.busGuestName}, '%') |
| | | </if> |
| | | <if test="queryDTO.scheduleName !=null and queryDTO.scheduleName !=''"> |
| | | AND t.schedule_name LIKE CONCAT('%', #{queryDTO.scheduleName}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.create_time >= CURDATE() |
| | | AND t.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.create_time >= #{queryDTO.startTime} |
| | | AND t.create_time <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | <select id="selectCurrentOverdue" resultType="com.by4cloud.platformx.business.vo.HomeOverdueStaVo"> |
| | | SELECT |
| | | sum( receivable_amount ) receivable_amount |
| | | FROM |
| | | current_overdue t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t.bus_guest_id AND t2.del_flag = '0' ) |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.create_time >= CURDATE() |
| | | AND t.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | GROUP BY |
| | | t.comp_id |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="compId" column="comp_id"/> |
| | | <result property="busGuestId" column="bus_guest_id"/> |
| | | <result property="busGuestName" column="bus_guest_name"/> |
| | | <result property="contractExpirTime" column="contract_expir_time"/> |
| | | <result property="contractExpirTime" column="create_time"/> |
| | | <result property="contractId" column="contract_id"/> |
| | | <result property="contractName" column="contract_name"/> |
| | | <result property="overdueDuration" column="overdue_duration"/> |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | <select id="homeZbjt" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum(co.receivable_amount) |
| | | FROM |
| | | history_overdue co |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZgs" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= CURDATE() |
| | | AND co.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum( co.receivable_amount ) |
| | | FROM |
| | | history_overdue co, |
| | | business_customer bc |
| | | WHERE |
| | | co.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = co.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND co.comp_id = #{compId} |
| | | AND co.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND co.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | <select id="selectHistoryOverdue" resultType="com.by4cloud.platformx.business.vo.HomeOverdueStaVo"> |
| | | SELECT |
| | | sum( receivable_amount ) receivable_amount |
| | | FROM |
| | | history_overdue t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t.bus_guest_id AND t2.del_flag = '0' ) |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.create_time >= CURDATE() |
| | | AND t.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | GROUP BY |
| | | t.comp_id |
| | | </select> |
| | | <select id="pageScope" resultType="com.by4cloud.platformx.business.vo.HomeOverdueVo"> |
| | | SELECT |
| | | t.id, |
| | | t.bus_guest_name, |
| | | t.bus_guest_id, |
| | | t.contract_name, |
| | | t.contract_id, |
| | | t.receivable_amount, |
| | | t.schedule_id, |
| | | t.schedule_name, |
| | | t.contract_expir_time, |
| | | t.overdue_duration, |
| | | t1.contract_no, |
| | | t.comp_id |
| | | FROM |
| | | history_overdue t |
| | | LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' ) |
| | | LEFT JOIN business_customer t2 ON ( t2.id = t.bus_guest_id AND t2.del_flag = '0' ) |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND t1.contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.busGuestName !=null and queryDTO.busGuestName !=''"> |
| | | AND t2.company_name LIKE CONCAT('%', #{queryDTO.busGuestName}, '%') |
| | | </if> |
| | | <if test="queryDTO.scheduleName !=null and queryDTO.scheduleName !=''"> |
| | | AND t.schedule_name LIKE CONCAT('%', #{queryDTO.scheduleName}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t2.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t2.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.create_time >= CURDATE() |
| | | AND t.create_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.create_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.create_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.create_time >= #{queryDTO.startTime} |
| | | AND t.create_time <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | <select id="homeZbjt" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) sgbbr, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) sgbby, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) sgbbn, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) jxcbr, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) jxcby, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) jxcbn, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) tfbr, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) tfby, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) tfbn, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) ymjbr, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) ymjby, |
| | | ( |
| | | SELECT |
| | | sum( ps.payment_amount ) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) ymjbn |
| | | </select> |
| | | <select id="homeZgs" resultType="com.by4cloud.platformx.business.vo.HomeZgsVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hbbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hbby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '2' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hbbn, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xbbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xbby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '6' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xbbn, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) dbbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) dbby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '1' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) dbbn, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hdbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hdby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '3' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hdbn, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) znbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) znby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '4' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) znbn, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) xnbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) xnby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.area_id = '5' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) xnbn, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) hwbr, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) hwby, |
| | | ( |
| | | SELECT |
| | | sum(ps.payment_amount) |
| | | FROM |
| | | payment_slip ps, |
| | | business_customer bc |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = ps.bus_guest_id |
| | | AND bc.export_service_attr = '2' |
| | | AND ps.comp_id = #{compId} |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) hwbn |
| | | </select> |
| | | <select id="pageScope" resultType="com.by4cloud.platformx.business.vo.HomePaymentSlipVo"> |
| | | SELECT |
| | | t.id, |
| | | t.bus_guest_name, |
| | | t.bus_guest_id, |
| | | t.payee, |
| | | t.payee_comp_id, |
| | | t.payment_time, |
| | | t.payment_amount, |
| | | t.payment_number, |
| | | t.pay_type, |
| | | t.create_by, |
| | | t.update_by, |
| | | t.create_time, |
| | | t.update_time, |
| | | t.del_flag, |
| | | t.comp_id |
| | | FROM |
| | | payment_slip t |
| | | LEFT JOIN business_customer t1 ON ( t1.id = t.bus_guest_id AND t1.del_flag = '0' ) |
| | | WHERE |
| | | t.del_flag = '0' |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND t.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> |
| | | AND t.bus_guest_name LIKE CONCAT('%', #{queryDTO.partyA}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t1.class_id = #{queryDTO.queryArea} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t1.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND t.payment_time >= CURDATE() |
| | | AND t.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND t.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND t.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND t.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND t.payment_time >= #{queryDTO.startTime} |
| | | AND t.payment_time <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | </mapper> |