123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.caimei.modules.bulkpurchase.dao.OrderInvoiceDao">
- <sql id="orderInvoiceColumns">
- a.*
- </sql>
- <select id="get" resultType="OrderInvoice">
- SELECT
- <include refid="orderInvoiceColumns"/>
- FROM bp_order_invoice a
- WHERE a.id = #{id}
- </select>
- <select id="findList" resultType="OrderInvoice">
- SELECT
- <include refid="orderInvoiceColumns"/>
- FROM bp_order_invoice a
- <where>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <select id="findAllList" resultType="OrderInvoice">
- SELECT
- <include refid="orderInvoiceColumns"/>
- FROM bp_order_invoice a
- <where>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <insert id="insert" parameterType="OrderInvoice" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO bp_order_invoice(orderId,
- invoiceTitle,
- invoiceType,
- type,
- invoiceContent,
- invoiceTitleType,
- registeredAddress,
- registeredPhone,
- bankAccountNo,
- openBank,
- corporationTaxNum)
- VALUES (#{orderId},
- #{invoiceTitle},
- #{invoiceType},
- #{type},
- #{invoiceContent},
- #{invoiceTitleType},
- #{registeredAddress},
- #{registeredPhone},
- #{bankAccountNo},
- #{openBank},
- #{corporationTaxNum})
- </insert>
- <update id="update">
- UPDATE bp_order_invoice SET
- <if test="invoiceTitle != null and invoiceTitle != ''">
- invoiceTitle = #{invoiceTitle},
- </if>
- <if test="type != null and type != ''">
- type = #{type},
- </if>
- <if test="invoiceType != null and invoiceType != ''">
- invoiceType = #{invoiceType},
- </if>
- <if test="invoiceContent != null and invoiceContent != ''">
- invoiceContent = #{invoiceContent},
- </if>
- <if test="invoiceTitleType != null and invoiceTitleType != ''">
- invoiceTitleType = #{invoiceTitleType},
- </if>
- <if test="registeredAddress != null and registeredAddress != ''">
- registeredAddress = #{registeredAddress},
- </if>
- <if test="registeredPhone != null and registeredPhone != ''">
- registeredPhone = #{registeredPhone},
- </if>
- <if test="bankAccountNo != null and bankAccountNo != ''">
- bankAccountNo = #{bankAccountNo},
- </if>
- <if test="openBank != null and openBank != ''">
- openBank = #{openBank},
- </if>
- <if test="corporationTaxNum != null and corporationTaxNum != ''">
- corporationTaxNum = #{corporationTaxNum},
- </if>
- orderId = #{orderId}
- WHERE id = #{id}
- </update>
- <select id="getWithorderId" resultType="OrderInvoice">
- SELECT *
- from bp_order_invoice
- where orderId = #{orderId}
- </select>
- <delete id="delete">
- DELETE
- FROM bp_order_invoice
- WHERE id = #{id}
- </delete>
- <update id="updateByID">
- UPDATE bp_order_invoice
- SET invoiceTitle = #{invoiceTitle},
- type = #{type},
- invoiceType = #{invoiceType},
- invoiceContent = #{invoiceContent},
- invoiceTitleType = #{invoiceTitleType},
- registeredAddress = #{registeredAddress},
- registeredPhone = #{registeredPhone},
- bankAccountNo = #{bankAccountNo},
- openBank = #{openBank},
- corporationTaxNum = #{corporationTaxNum},
- orderId = #{orderId}
- WHERE id = #{id}
- </update>
- </mapper>
|