123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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.njyunzhi.invoice.mapper.TaInvoiceDetailMapper">
-
- <insert id="createBatch">
-
- INSERT INTO ta_invoice_detail (
- `detail_id`,
- `invoice_id`,
- `invoice_person_id`,
- `person_id`,
- `person_name`,
- `invoice_org_id`,
- `org_id`,
- `org_name`,
- `tax_no`,
- `address`,
- `phone`,
- `bank_id`,
- `bank_name`,
- `card_no`,
- `invoice_item_tpl_id`,
- `item_name`,
- `charge`,
- `merge_remark`,
- `stay_remark`,
- `status`,
- `create_date`
- ) SELECT
- UUID_SHORT( ),
- t.invoice_id,
- t.invoice_person_id,
- NULL,
- t.`name`,
- t.invoice_org_id,
- NULL,
- t.org_name,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- s.invoice_item_tpl_id,
- s.`name`,
- s.charge,
- NULL,
- NULL,
- 1,
- now( )
- FROM
- ta_invoice_person t
- INNER JOIN ta_invoice_item_tpl s ON t.invoice_id = s.invoice_id
- WHERE
- t.invoice_id = #{invoiceId}
- AND t.`status` > -1
- AND s.`status` > -1
- </insert>
- <select id="getByPerson" resultType="com.njyunzhi.invoice.entity.TaInvoiceDetail">
- SELECT
- *
- FROM
- ta_invoice_detail t
- WHERE
- t.invoice_id = #{invoiceId}
- AND t.person_id = #{personId}
- AND t.`status` > -1
- </select>
- </mapper>
|