|
@@ -6,9 +6,12 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.workark.model.Invoice" id="result">
|
|
|
<id column="id" property="id"/>
|
|
|
+ <result column="invoiceModelId" property="invoiceModelId"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="userId" property="userId"/>
|
|
|
<result column="createTime" property="createTime"/>
|
|
|
<result column="updateTime" property="updateTime"/>
|
|
|
- <result column="orderId" property="orderId"/>
|
|
|
+ <result column="orderNo" property="orderNo"/>
|
|
|
<result column="type" property="type"/>
|
|
|
<result column="name" property="name"/>
|
|
|
<result column="taxpayerIdentificationNumber" property="taxpayerIdentificationNumber"/>
|
|
@@ -26,9 +29,22 @@
|
|
|
select * from workark_invoice where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getOrderNo" resultMap="result">
|
|
|
+ select * from workark_invoice where orderNo = #{orderNo}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getList" resultMap="result">
|
|
|
select * from workark_invoice
|
|
|
<where>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != 0">
|
|
|
+ and userId = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="invoiceModelId != 0">
|
|
|
+ and invoiceModelId = #{invoiceModelId}
|
|
|
+ </if>
|
|
|
<if test="orderNo != null">
|
|
|
and orderNo = #{orderNo}
|
|
|
</if>
|
|
@@ -62,6 +78,15 @@
|
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.api.workark.model.Invoice" resultType="Integer">
|
|
|
SELECT count(*) FROM workark_invoice
|
|
|
<where>
|
|
|
+ <if test="invoiceModelId != 0">
|
|
|
+ and invoiceModelId = #{invoiceModelId}
|
|
|
+ </if>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != 0">
|
|
|
+ and userId = #{userId}
|
|
|
+ </if>
|
|
|
<if test="orderNo != null">
|
|
|
and orderNo = #{orderNo}
|
|
|
</if>
|
|
@@ -95,6 +120,15 @@
|
|
|
<select id="getLimit" resultMap="result">
|
|
|
select * from workark_invoice
|
|
|
<where>
|
|
|
+ <if test="p.invoiceModelId != 0">
|
|
|
+ and invoiceModelId = #{p.invoiceModelId}
|
|
|
+ </if>
|
|
|
+ <if test="p.organizationId != 0">
|
|
|
+ and organizationId = #{p.organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="p.userId != 0">
|
|
|
+ and userId = #{p.userId}
|
|
|
+ </if>
|
|
|
<if test="p.orderNo != null">
|
|
|
and orderNo = #{p.orderNo}
|
|
|
</if>
|
|
@@ -127,17 +161,21 @@
|
|
|
</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 INTO workark_invoice (`organizationId`, `userId`, `invoiceModelId`, `createTime`, `orderNo`, `type`, `name`, `taxpayerIdentificationNumber`, `address`, `phone`, `bankAccount`, `bankAccountNumber`, `content`, `amount`, `file`)
|
|
|
+ VALUES (#{organizationId}, #{userId}, #{invoiceModelId}, 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="invoiceModelId != 0">invoiceModelId = #{invoiceModelId},</if>
|
|
|
+ <if test="organizationId != 0">organizationId = #{organizationId},</if>
|
|
|
+ <if test="userId != 0">userId = #{userId},</if>
|
|
|
<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="address != null">address = #{address},</if>
|
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
|
<if test="bankAccount != null">bankAccount = #{bankAccount},</if>
|
|
|
<if test="bankAccountNumber != null">bankAccountNumber = #{bankAccountNumber},</if>
|