|
@@ -8,6 +8,40 @@
|
|
|
<id column="id" property="id"/>
|
|
|
<result column="paymentOrdinaryId" property="paymentOrdinaryId"/>
|
|
|
<result column="paymentId" property="paymentId"/>
|
|
|
+
|
|
|
+ <result column="projectId" property="projectId"/>
|
|
|
+ <result column="projectItemTargetRoomIds" property="projectItemTargetRoomIds"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="code" property="code"/>
|
|
|
+ <result column="number" property="number"/>
|
|
|
+ <result column="payMerchantId" property="payMerchantId"/>
|
|
|
+ <result column="payClientId" property="payClientId"/>
|
|
|
+ <result column="cargoName" property="cargoName"/>
|
|
|
+
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="date" property="date"/>
|
|
|
+ <result column="attachment" property="attachment"/>
|
|
|
+ <result column="data" property="data"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.PaymentInvoice" id="paymentInvoiceResult">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="paymentOrdinaryId" property="paymentOrdinaryId"/>
|
|
|
+ <result column="paymentId" property="paymentId"/>
|
|
|
+
|
|
|
+ <result column="projectId" property="projectId"/>
|
|
|
+ <result column="projectItemTargetRoomIds" property="projectItemTargetRoomIds"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="code" property="code"/>
|
|
|
+ <result column="number" property="number"/>
|
|
|
+ <result column="payMerchantId" property="payMerchantId"/>
|
|
|
+ <result column="payMerchantName" property="payMerchantName"/>
|
|
|
+ <result column="payClientId" property="payClientId"/>
|
|
|
+ <result column="payClientName" property="payClientName"/>
|
|
|
+ <result column="cargoName" property="cargoName"/>
|
|
|
+
|
|
|
<result column="name" property="name"/>
|
|
|
<result column="date" property="date"/>
|
|
|
<result column="attachment" property="attachment"/>
|
|
@@ -15,8 +49,12 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.PaymentInvoice" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO payment_invoice (`paymentOrdinaryId`, `paymentId`, `name`, `date`, `attachment`, `data`)
|
|
|
- VALUES (#{paymentOrdinaryId}, #{paymentId}, #{name}, #{date}, #{attachment}, #{data})
|
|
|
+ INSERT INTO payment_invoice (`paymentOrdinaryId`, `paymentId`,
|
|
|
+ `projectId`, `projectItemTargetRoomIds`, `type`, `status`, `code`, `number`, `payMerchantId`, `payClientId`, `cargoName`,
|
|
|
+ `name`, `date`, `attachment`, `data`)
|
|
|
+ VALUES (#{paymentOrdinaryId}, #{paymentId},
|
|
|
+ #{projectId}, #{projectItemTargetRoomIds}, #{type}, #{status}, #{code}, #{number}, #{payMerchantId}, #{payClientId}, #{cargoName},
|
|
|
+ #{name}, #{date}, #{attachment}, #{data})
|
|
|
</insert>
|
|
|
|
|
|
<delete id="delete">
|
|
@@ -29,6 +67,18 @@
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
<if test="paymentOrdinaryId!=0">paymentOrdinaryId=#{paymentOrdinaryId},</if>
|
|
|
<if test="paymentId!=0">paymentId=#{paymentId},</if>
|
|
|
+
|
|
|
+ <if test="projectId!=0">projectId=#{projectId},</if>
|
|
|
+ <if test="projectItemTargetRoomIds!=null">projectItemTargetRoomIds=#{projectItemTargetRoomIds},</if>
|
|
|
+ <if test="type!=null">type=#{type},</if>
|
|
|
+ <if test="status!=null">status=#{status},</if>
|
|
|
+ <if test="code!=null">code=#{code},</if>
|
|
|
+ <if test="number!=null">number=#{number},</if>
|
|
|
+ <if test="payMerchantId!=0">payMerchantId=#{payMerchantId},</if>
|
|
|
+ <if test="payClientId!=0">payClientId=#{payClientId},</if>
|
|
|
+ <if test="cargoName!=null">cargoName=#{cargoName},</if>
|
|
|
+
|
|
|
+
|
|
|
<if test="name!=null">name=#{name},</if>
|
|
|
<if test="date!=null">date=#{date},</if>
|
|
|
<if test="attachment!=null">attachment=#{attachment},</if>
|
|
@@ -37,11 +87,75 @@
|
|
|
WHERE id=#{id}
|
|
|
</update>
|
|
|
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.PaymentInvoice" resultType="Integer">
|
|
|
+ SELECT count(*) FROM payment_invoice
|
|
|
+ <where>
|
|
|
+ <if test="paymentOrdinaryId!=0">and paymentOrdinaryId=#{paymentOrdinaryId}</if>
|
|
|
+ <if test="paymentId!=0">and paymentId=#{paymentId}</if>
|
|
|
+
|
|
|
+ <if test="projectId!=0">and projectId=#{projectId}</if>
|
|
|
+ <if test="projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{projectItemTargetRoomIds}</if>
|
|
|
+ <if test="type!=null">and type=#{type}</if>
|
|
|
+ <if test="status!=null">and status=#{status}</if>
|
|
|
+ <if test="code!=null">and code=#{code}</if>
|
|
|
+ <if test="number!=null">and number=#{number},</if>
|
|
|
+ <if test="payMerchantId!=0">and payMerchantId=#{payMerchantId}</if>
|
|
|
+ <if test="payClientId!=0">and payClientId=#{payClientId}</if>
|
|
|
+ <if test="cargoName!=null">and cargoName=#{cargoName}</if>
|
|
|
+
|
|
|
+ <if test="name!=null">and name=#{name}</if>
|
|
|
+ <if test="date!=null">and date=#{date}</if>
|
|
|
+ <if test="attachment!=null">and attachment=#{attachment}</if>
|
|
|
+ <if test="data!=null">and data=#{data}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="query">
|
|
|
+ SELECT a.*, c.name as payMerchantName, d.name as payClientName FROM payment_invoice a
|
|
|
+ LEFT JOIN merchant c ON a.payMerchantId = c.id
|
|
|
+ LEFT JOIN mgr_client d ON a.payClientId = d.id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="paymentInvoiceResult">
|
|
|
+ <include refid="query"/>
|
|
|
+ <where>
|
|
|
+ <if test="p.paymentOrdinaryId!=0">and a.paymentOrdinaryId=#{p.paymentOrdinaryId}</if>
|
|
|
+ <if test="p.paymentId!=0">and a.paymentId=#{p.paymentId}</if>
|
|
|
+
|
|
|
+ <if test="p.projectId!=0">and a.projectId=#{p.projectId}</if>
|
|
|
+ <if test="p.projectItemTargetRoomIds!=null">and a.projectItemTargetRoomIds=#{p.projectItemTargetRoomIds}</if>
|
|
|
+ <if test="p.type!=null">and a.type=#{p.type}</if>
|
|
|
+ <if test="p.status!=null">and a.status=#{p.status}</if>
|
|
|
+ <if test="p.code!=null">and a.code=#{p.code}</if>
|
|
|
+ <if test="p.number!=null">and a.number=#{p.number},</if>
|
|
|
+ <if test="p.payMerchantId!=0">and a.payMerchantId=#{p.payMerchantId}</if>
|
|
|
+ <if test="p.payClientId!=0">and a.payClientId=#{p.payClientId}</if>
|
|
|
+ <if test="p.cargoName!=null">and a.cargoName=#{p.cargoName}</if>
|
|
|
+
|
|
|
+ <if test="p.name!=null">and a.name=#{p.name}</if>
|
|
|
+ <if test="p.date!=null">and a.date=#{p.date}</if>
|
|
|
+ <if test="p.attachment!=null">and a.attachment=#{p.attachment}</if>
|
|
|
+ <if test="p.data!=null">and a.data=#{p.data}</if>
|
|
|
+ </where>
|
|
|
+ limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getList" resultMap="result">
|
|
|
SELECT * FROM payment_invoice
|
|
|
<where>
|
|
|
<if test="paymentOrdinaryId!=0">and paymentOrdinaryId=#{paymentOrdinaryId}</if>
|
|
|
<if test="paymentId!=0">and paymentId=#{paymentId}</if>
|
|
|
+
|
|
|
+ <if test="projectId!=0">and projectId=#{projectId}</if>
|
|
|
+ <if test="projectItemTargetRoomIds!=null">and projectItemTargetRoomIds=#{projectItemTargetRoomIds}</if>
|
|
|
+ <if test="type!=null">and type=#{type}</if>
|
|
|
+ <if test="status!=null">and status=#{status}</if>
|
|
|
+ <if test="code!=null">and code=#{code}</if>
|
|
|
+ <if test="number!=null">and number=#{number},</if>
|
|
|
+ <if test="payMerchantId!=0">and payMerchantId=#{payMerchantId}</if>
|
|
|
+ <if test="payClientId!=0">and payClientId=#{payClientId}</if>
|
|
|
+ <if test="cargoName!=null">and cargoName=#{cargoName}</if>
|
|
|
+
|
|
|
<if test="name!=null">and name=#{name}</if>
|
|
|
<if test="date!=null">and date=#{date}</if>
|
|
|
<if test="attachment!=null">and attachment=#{attachment}</if>
|
|
@@ -58,7 +172,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="get" resultMap="result">
|
|
|
- SELECT * FROM payment_invoice where id = #{id}
|
|
|
+ <include refid="query"/>
|
|
|
+ where a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|