123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.idea.invoice.mapper.InvoiceManageExtendMapper">
- <select id="listByModel" resultType="com.idea.invoice.dto.InvoiceManageDto">
- select i.*,cm.id contractId,cm.contract_number,cm.record_number,cm.buyer_name,cm.house_name,
- ifnull(cm.buyer_money,0) buyer_money,
- ifnull(cm.maintenance_total_price,0) maintenance_total_price,
- ifnull(cm.total_price,0) receivable_money,
- cm.collection_status,cm.fund_collection_status
- from invoice_manage i
- left join idea_settle_down.contract_manage cm on i.contract_id = cm.id
- <where>
- <if test="type !=null and type !=''">
- and i.type = #{type}
- </if>
- <if test="buyerName !=null and buyerName !=''">
- and cm.buyer_name like concat('%',#{buyerName},'%')
- </if>
- <if test="houseName !=null and houseName !=''">
- and cm.house_name like concat('%',#{houseName},'%')
- </if>
- <if test="sendStatus !=null and sendStatus !=''">
- and i.send_status = #{sendStatus}
- </if>
- <if test="sendDateFrom !=null and sendDateFrom !=''">
- and i.submit_time >= #{sendDateFrom}
- </if>
- <if test="sendDateTo !=null and sendDateTo !=''">
- and i.submit_time <= #{sendDateTo}
- </if>
- <if test="invoiceStatus !=null and invoiceStatus !=''">
- and i.invoice_status = #{invoiceStatus}
- </if>
- <if test="invoiceDateFrom !=null and invoiceDateFrom !=''">
- and i.invoice_date >= #{invoiceDateFrom}
- </if>
- <if test="invoiceDateTo !=null and invoiceDateTo !=''">
- and i.invoice_date <= #{sendDateTo}
- </if>
- <if test="houseId !=null and houseId !=''">
- cm.house_id = #{houseId}
- </if>
- </where>
- order by i.create_time desc
- </select>
- <select id="selectNeedRefreshStatusList" resultType="com.idea.invoice.model.InvoiceManage">
- select * from invoice_manage where nc_code is null or nc_code = ''
- </select>
- </mapper>
|