|
@@ -6,6 +6,8 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.model.PaymentOrdinary" id="result">
|
|
<resultMap type="com.bosshand.virgo.api.model.PaymentOrdinary" id="result">
|
|
<id column="id" property="id"/>
|
|
<id column="id" property="id"/>
|
|
|
|
+ <result column="contractId" property="contractId"/>
|
|
|
|
+ <result column="contractCode" property="contractCode"/>
|
|
<result column="name" property="name"/>
|
|
<result column="name" property="name"/>
|
|
<result column="date" property="date"/>
|
|
<result column="date" property="date"/>
|
|
<result column="reminderDate" property="reminderDate"/>
|
|
<result column="reminderDate" property="reminderDate"/>
|
|
@@ -24,8 +26,8 @@
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.PaymentOrdinary" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.PaymentOrdinary" useGeneratedKeys="true" keyProperty="id">
|
|
- INSERT INTO payment_ordinary(`name`, `date`, `reminderDate`, `projectId`, `organizationId`, `payMerchantId`, `payClientId`, `tenantType`, `amount`, `data`, `status`, `type`)
|
|
|
|
- VALUES (#{name}, now(), #{reminderDate}, #{projectId}, #{organizationId}, #{payMerchantId}, #{payClientId}, #{tenantType}, #{amount}, #{data}, #{status}, #{type})
|
|
|
|
|
|
+ INSERT INTO payment_ordinary(`contractId`,`name`, `date`, `reminderDate`, `projectId`, `organizationId`, `payMerchantId`, `payClientId`, `tenantType`, `amount`, `data`, `status`, `type`)
|
|
|
|
+ VALUES (#{contractId}, #{name}, now(), #{reminderDate}, #{projectId}, #{organizationId}, #{payMerchantId}, #{payClientId}, #{tenantType}, #{amount}, #{data}, #{status}, #{type})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<delete id="delete">
|
|
<delete id="delete">
|
|
@@ -35,6 +37,7 @@
|
|
<update id="update" parameterType="com.bosshand.virgo.api.model.PaymentOrdinary">
|
|
<update id="update" parameterType="com.bosshand.virgo.api.model.PaymentOrdinary">
|
|
UPDATE payment_ordinary
|
|
UPDATE payment_ordinary
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
+ <if test="contractId != 0">contractId = #{contractId},</if>
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="reminderDate != null">reminderDate = #{reminderDate},</if>
|
|
<if test="reminderDate != null">reminderDate = #{reminderDate},</if>
|
|
<if test="projectId != 0">projectId = #{projectId},</if>
|
|
<if test="projectId != 0">projectId = #{projectId},</if>
|
|
@@ -53,6 +56,9 @@
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.PaymentOrdinary" resultType="Integer">
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.PaymentOrdinary" resultType="Integer">
|
|
SELECT count(*) FROM payment_ordinary
|
|
SELECT count(*) FROM payment_ordinary
|
|
<where>
|
|
<where>
|
|
|
|
+ <if test="contractId != 0">
|
|
|
|
+ and contractId = #{contractId}
|
|
|
|
+ </if>
|
|
<if test="name != null">
|
|
<if test="name != null">
|
|
and name = #{name}
|
|
and name = #{name}
|
|
</if>
|
|
</if>
|
|
@@ -89,10 +95,11 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<sql id="query">
|
|
<sql id="query">
|
|
- SELECT a.*, b.name as organizationName, c.name as payMerchantName, d.name as payClientName FROM payment_ordinary a
|
|
|
|
|
|
+ SELECT a.*, b.name as organizationName, c.name as payMerchantName, d.name as payClientName, e.code as contractCode FROM payment_ordinary a
|
|
LEFT JOIN mgr_organization b ON a.organizationId = b.id
|
|
LEFT JOIN mgr_organization b ON a.organizationId = b.id
|
|
LEFT JOIN merchant c ON a.payMerchantId = c.id
|
|
LEFT JOIN merchant c ON a.payMerchantId = c.id
|
|
LEFT JOIN mgr_client d ON a.payClientId = d.id
|
|
LEFT JOIN mgr_client d ON a.payClientId = d.id
|
|
|
|
+ LEFT JOIN contract e ON a.contractId = e.id
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="get" resultMap="result">
|
|
<select id="get" resultMap="result">
|
|
@@ -102,6 +109,9 @@
|
|
<select id="getLimit" resultMap="result">
|
|
<select id="getLimit" resultMap="result">
|
|
<include refid="query"/>
|
|
<include refid="query"/>
|
|
<where>
|
|
<where>
|
|
|
|
+ <if test="p.contractId != 0">
|
|
|
|
+ and a.contractId = #{p.contractId}
|
|
|
|
+ </if>
|
|
<if test="p.name != null">
|
|
<if test="p.name != null">
|
|
and a.name = #{p.name}
|
|
and a.name = #{p.name}
|
|
</if>
|
|
</if>
|