| | |
| | | <id column="id" property="id" /> |
| | | <result column="code" property="code" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="partner_id" property="partnerId" /> |
| | | <result column="order_type" property="orderType" /> |
| | | <result column="invoicing_company" property="invoicingCompany" /> |
| | | <result column="invoice_type_id" property="invoiceTypeId"/> |
| | |
| | | <result column="total_amount" property="totalAmount" /> |
| | | <result column="invoice_url" property="invoiceUrl" /> |
| | | <result column="mailbox" property="mailbox" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="billing_time" property="billingTime" /> |
| | | <result column="billing_user_id" property="billingUserId" /> |
| | | <result column="cancel_time" property="cancelTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, app_user_id, order_type, invoicing_company, invoice_type_id, invoice_type, invoice_material, invoicing_method, invoicing_object_type, name, tax_identification_number, company_address, company_phone, deposit_bank, bank_account, total_amount, invoice_url, mailbox, status, create_time, billing_time, billing_user_id |
| | | id, code, app_user_id, site_id, partner_id, order_type, invoicing_company, invoice_type_id, invoice_type, invoice_material, invoicing_method, invoicing_object_type, name, tax_identification_number, company_address, company_phone, deposit_bank, bank_account, total_amount, invoice_url, mailbox, remark, status, create_time, billing_time, billing_user_id, cancel_time |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.order.api.vo.TOrderInvoiceVO"> |
| | | select toi.id, toi.code, toi.app_user_id, toi.site_id, toi.partner_id, toi.order_type, toi.invoicing_company, toi.invoice_type_id, toi.invoice_type, toi.invoice_material, |
| | | toi.invoicing_method, toi.invoicing_object_type, toi.name, toi.tax_identification_number, toi.company_address, toi.company_phone, |
| | | toi.deposit_bank, toi.bank_account, toi.total_amount, toi.invoice_url, toi.mailbox, toi.remark, toi.status, toi.create_time, toi.billing_time, |
| | | toi.billing_user_id, toi.cancel_time |
| | | from t_order_invoice toi |
| | | <where> |
| | | <if test="query.id != null"> |
| | | AND toi.id = #{query.id} |
| | | </if> |
| | | <if test="query.invoicingCompany != null and query.invoicingCompany != ''"> |
| | | AND toi.invoicing_company LIKE concat('%',#{query.invoicingCompany},'%') |
| | | </if> |
| | | <if test="query.invoiceType != null and query.invoiceType != ''"> |
| | | AND toi.invoice_type LIKE concat('%',#{query.invoiceType},'%') |
| | | </if> |
| | | <if test="query.invoicingObjectType != null"> |
| | | AND toi.invoicing_object_type = #{query.invoicingObjectType} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | AND toi.status = #{query.status} |
| | | </if> |
| | | <if test="query.invoiceMaterial != null"> |
| | | AND toi.invoice_material = #{query.invoiceMaterial} |
| | | </if> |
| | | <if test="query.invoicingMethod != null"> |
| | | AND toi.invoicing_method = #{query.invoicingMethod} |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | AND toi.name LIKE concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND toi.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND toi.app_user_id IN |
| | | <foreach collection="query.userIds" close=")" open="(" item="userId" separator=","> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | <if test="query.siteId != null"> |
| | | AND toi.site_id = #{query.siteId} |
| | | </if> |
| | | <if test="query.partnerId != null"> |
| | | AND toi.partner_id = #{query.partnerId} |
| | | </if> |
| | | <if test="query.directOnly != null and query.directOnly == 1"> |
| | | AND toi.site_id IN ( |
| | | SELECT id FROM charging_pile_service.t_site WHERE business_category = 1 |
| | | ) |
| | | </if> |
| | | </where> |
| | | ORDER BY toi.create_time DESC |
| | | </select> |
| | | <select id="statusCount" resultType="java.util.Map"> |
| | | select |
| | | COUNT(CASE WHEN status = 1 THEN 1 END) AS `notAccepted`, |
| | | COUNT(CASE WHEN status = 2 THEN 1 END) AS `processing`, |
| | | COUNT(CASE WHEN status = 3 THEN 1 END) AS `finished`, |
| | | COUNT(CASE WHEN status = 4 THEN 1 END) AS `cancelled` |
| | | from t_order_invoice toi |
| | | <where> |
| | | <if test="query.id != null"> |
| | | AND toi.id = #{query.id} |
| | | </if> |
| | | <if test="query.invoicingCompany != null and query.invoicingCompany != ''"> |
| | | AND toi.invoicing_company LIKE concat('%',#{query.invoicingCompany},'%') |
| | | </if> |
| | | <if test="query.invoiceType != null and query.invoiceType != ''"> |
| | | AND toi.invoice_type LIKE concat('%',#{query.invoiceType},'%') |
| | | </if> |
| | | <if test="query.invoicingObjectType != null"> |
| | | AND toi.invoicing_object_type = #{query.invoicingObjectType} |
| | | </if> |
| | | <if test="query.invoiceMaterial != null"> |
| | | AND toi.invoice_material = #{query.invoiceMaterial} |
| | | </if> |
| | | <if test="query.invoicingMethod != null"> |
| | | AND toi.invoicing_method = #{query.invoicingMethod} |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | AND toi.name LIKE concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND toi.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND toi.app_user_id IN |
| | | <foreach collection="query.userIds" close=")" open="(" item="userId" separator=","> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | <if test="query.siteId != null"> |
| | | AND toi.site_id = #{query.siteId} |
| | | </if> |
| | | <if test="query.partnerId != null"> |
| | | AND toi.partner_id = #{query.partnerId} |
| | | </if> |
| | | <if test="query.directOnly != null and query.directOnly == 1"> |
| | | AND toi.site_id IN ( |
| | | SELECT id FROM charging_pile_service.t_site WHERE business_category = 1 |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="export" resultType="com.ruoyi.order.api.vo.TOrderInvoiceVO"> |
| | | select toi.id, toi.code, toi.app_user_id, toi.site_id, toi.partner_id, toi.order_type, toi.invoicing_company, toi.invoice_type_id, toi.invoice_type, toi.invoice_material, |
| | | toi.invoicing_method, toi.invoicing_object_type, toi.name, toi.tax_identification_number, toi.company_address, toi.company_phone, |
| | | toi.deposit_bank, toi.bank_account, toi.total_amount, toi.invoice_url, toi.mailbox, toi.remark, toi.status, toi.create_time, toi.billing_time, |
| | | toi.billing_user_id, toi.cancel_time |
| | | from t_order_invoice toi |
| | | <where> |
| | | <if test="query.id != null"> |
| | | AND toi.id = #{query.id} |
| | | </if> |
| | | <if test="query.invoicingCompany != null and query.invoicingCompany != ''"> |
| | | AND toi.invoicing_company LIKE concat('%',#{query.invoicingCompany},'%') |
| | | </if> |
| | | <if test="query.invoiceType != null and query.invoiceType != ''"> |
| | | AND toi.invoice_type LIKE concat('%',#{query.invoiceType},'%') |
| | | </if> |
| | | <if test="query.invoicingObjectType != null"> |
| | | AND toi.invoicing_object_type = #{query.invoicingObjectType} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | AND toi.status = #{query.status} |
| | | </if> |
| | | <if test="query.invoiceMaterial != null"> |
| | | AND toi.invoice_material = #{query.invoiceMaterial} |
| | | </if> |
| | | <if test="query.invoicingMethod != null"> |
| | | AND toi.invoicing_method = #{query.invoicingMethod} |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | AND toi.name LIKE concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND toi.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND toi.app_user_id IN |
| | | <foreach collection="query.userIds" close=")" open="(" item="userId" separator=","> |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | <if test="query.siteId != null"> |
| | | AND toi.site_id = #{query.siteId} |
| | | </if> |
| | | <if test="query.partnerId != null"> |
| | | AND toi.partner_id = #{query.partnerId} |
| | | </if> |
| | | <if test="query.directOnly != null and query.directOnly == 1"> |
| | | AND toi.site_id IN ( |
| | | SELECT id FROM charging_pile_service.t_site WHERE business_category = 1 |
| | | ) |
| | | </if> |
| | | </where> |
| | | ORDER BY toi.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |