feat:分账
This commit is contained in:
@@ -14,11 +14,17 @@
|
||||
<result column="allocation_status" property="allocationStatus" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="deleted" property="deleted" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, order_id, shop_id, pay_no, expense_type, payee_name, payee_code,
|
||||
pay_amount, allocation_status, create_time, update_time
|
||||
pay_amount, allocation_status, create_time, update_time, remark, deleted
|
||||
</sql>
|
||||
|
||||
<sql id="Not_Deleted_Condition">
|
||||
deleted = 0
|
||||
</sql>
|
||||
|
||||
<select id="getById" resultMap="BaseResultMap">
|
||||
@@ -31,6 +37,7 @@
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE order_id = #{orderId}
|
||||
AND <include refid="Not_Deleted_Condition"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -38,6 +45,7 @@
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE shop_id = #{shopId}
|
||||
AND <include refid="Not_Deleted_Condition"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -45,14 +53,16 @@
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE shop_id = #{shopId}
|
||||
and expense_type = #{expenseType}
|
||||
AND expense_type = #{expenseType}
|
||||
ORDER BY create_time DESC
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="queryPageByPayNo" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE pay_no = #{payNo}
|
||||
AND <include refid="Not_Deleted_Condition"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -130,6 +140,23 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="softDeleteById">
|
||||
UPDATE zxjp_pre_allocation_record
|
||||
SET deleted = 1,
|
||||
update_time = NOW()
|
||||
WHERE id = #{id}
|
||||
AND <include refid="Not_Deleted_Condition"/>
|
||||
</update>
|
||||
|
||||
<update id="softDeleteByIds">
|
||||
UPDATE zxjp_pre_allocation_record
|
||||
SET deleted = 1,
|
||||
update_time = NOW()
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
AND <include refid="Not_Deleted_Condition"/>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user