|
@@ -0,0 +1,157 @@
|
|
|
|
+<!DOCTYPE mapper
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
+
|
|
|
|
+<mapper namespace="com.bosshand.virgo.api.workark.dao.InvoiceDao">
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.bosshand.virgo.api.workark.model.Invoice" id="result">
|
|
|
|
+ <id column="id" property="id"/>
|
|
|
|
+ <result column="createTime" property="createTime"/>
|
|
|
|
+ <result column="updateTime" property="updateTime"/>
|
|
|
|
+ <result column="orderId" property="orderId"/>
|
|
|
|
+ <result column="type" property="type"/>
|
|
|
|
+ <result column="name" property="name"/>
|
|
|
|
+ <result column="taxpayerIdentificationNumber" property="taxpayerIdentificationNumber"/>
|
|
|
|
+ <result column="address" property="address"/>
|
|
|
|
+ <result column="phone" property="phone"/>
|
|
|
|
+ <result column="bankAccount" property="bankAccount"/>
|
|
|
|
+ <result column="bankAccountNumber" property="bankAccountNumber"/>
|
|
|
|
+ <result column="content" property="content"/>
|
|
|
|
+ <result column="amount" property="amount"/>
|
|
|
|
+ <result column="file" property="file"/>
|
|
|
|
+ <result column="state" property="state"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <select id="get" resultMap="result">
|
|
|
|
+ select * from workark_invoice where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getList" resultMap="result">
|
|
|
|
+ select * from workark_invoice
|
|
|
|
+ <where>
|
|
|
|
+ <if test="orderNo != null">
|
|
|
|
+ and orderNo = #{orderNo}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ and type = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null">
|
|
|
|
+ and name = #{name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="taxpayerIdentificationNumber != null">
|
|
|
|
+ and taxpayerIdentificationNumber = #{taxpayerIdentificationNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="phone != null">
|
|
|
|
+ and phone = #{phone}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="bankAccount != null">
|
|
|
|
+ and bankAccount = #{bankAccount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="bankAccountNumber != null">
|
|
|
|
+ and bankAccountNumber = #{bankAccountNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="amount != null">
|
|
|
|
+ and amount = #{amount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="state != null">
|
|
|
|
+ and state = #{state}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.workark.model.Invoice" resultType="Integer">
|
|
|
|
+ SELECT count(*) FROM workark_invoice
|
|
|
|
+ <where>
|
|
|
|
+ <if test="orderNo != null">
|
|
|
|
+ and orderNo = #{orderNo}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ and type = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null">
|
|
|
|
+ and name = #{name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="taxpayerIdentificationNumber != null">
|
|
|
|
+ and taxpayerIdentificationNumber = #{taxpayerIdentificationNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="phone != null">
|
|
|
|
+ and phone = #{phone}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="bankAccount != null">
|
|
|
|
+ and bankAccount = #{bankAccount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="bankAccountNumber != null">
|
|
|
|
+ and bankAccountNumber = #{bankAccountNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="amount != null">
|
|
|
|
+ and amount = #{amount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="state != null">
|
|
|
|
+ and state = #{state}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getLimit" resultMap="result">
|
|
|
|
+ select * from workark_invoice
|
|
|
|
+ <where>
|
|
|
|
+ <if test="p.orderNo != null">
|
|
|
|
+ and orderNo = #{p.orderNo}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.type != null">
|
|
|
|
+ and type = #{p.type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.name != null">
|
|
|
|
+ and name = #{p.name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.taxpayerIdentificationNumber != null">
|
|
|
|
+ and taxpayerIdentificationNumber = #{p.taxpayerIdentificationNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.phone != null">
|
|
|
|
+ and phone = #{p.phone}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.bankAccount != null">
|
|
|
|
+ and bankAccount = #{p.bankAccount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.bankAccountNumber != null">
|
|
|
|
+ and bankAccountNumber = #{p.bankAccountNumber}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.amount != null">
|
|
|
|
+ and amount = #{p.amount}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="p.state != null">
|
|
|
|
+ and state = #{p.state}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ order by createTime desc limit #{currIndex} , #{pageSize}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ INSERT INTO workark_invoice (`createTime`, `orderNo`, `type`, `name`, `taxpayerIdentificationNumber`, `address`, `phone`, `bankAccount`, `bankAccountNumber`, `content`, `amount`, `file`)
|
|
|
|
+ VALUES (now(), #{orderNo}, #{type}, #{name}, #{taxpayerIdentificationNumber}, #{address}, #{phone}, #{bankAccount}, #{bankAccountNumber}, #{content}, #{amount}, #{file})
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.api.workark.model.Invoice">
|
|
|
|
+ UPDATE workark_invoice
|
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
|
+ <if test="orderNo != null">orderNo = #{orderNo},</if>
|
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
|
+ <if test="taxpayerIdentificationNumber != null">taxpayerIdentificationNumber = #{taxpayerIdentificationNumber},</if>
|
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
|
+ <if test="bankAccount != null">bankAccount = #{bankAccount},</if>
|
|
|
|
+ <if test="bankAccountNumber != null">bankAccountNumber = #{bankAccountNumber},</if>
|
|
|
|
+ <if test="amount != null">amount = #{amount},</if>
|
|
|
|
+ <if test="content != null">content = #{content},</if>
|
|
|
|
+ <if test="file != null">file = #{file},</if>
|
|
|
|
+ <if test="state != null">state = #{state},</if>
|
|
|
|
+ <if test="updateTime == null">updateTime = now(),</if>
|
|
|
|
+ </trim>
|
|
|
|
+ WHERE id=#{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="delete">
|
|
|
|
+ DELETE FROM workark_invoice WHERE id=#{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|