liql 4 năm trước cách đây
mục cha
commit
85c95af590

+ 88 - 0
carbon-h5/carbon-h5-service/src/main/resources/com/hcloud/microserver/h5/dao/SubscriptionApplyMapper.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microserver.h5.dao.SubscriptionApplyMapper">
+    
+    <resultMap type="SubscriptionApply" id="SubscriptionApplyResult">
+        <result property="guid"               column="guid"    />
+        <result property="applyCustomerId"    column="apply_customer_id"    />
+        <result property="applyCustomName"    column="apply_custom_name"    />
+        <result property="amount"             column="amount"    />
+        <result property="remark"             column="remark"    />
+        <result property="applyStatus"        column="apply_status"    />
+        <result property="recordStatus"       column="record_status"    />
+        <result property="applyDate"          column="apply_date"    />
+        <result property="createTime"         column="create_time"    />
+        <result property="modifiedTime"       column="modified_time"    />
+    </resultMap>
+
+    <sql id="selectSubscriptionApplyVo">
+        select guid, apply_customer_id, apply_custom_name, amount, remark, apply_status, record_status, apply_date, create_time, modified_time from t_subscription_apply
+    </sql>
+
+    <select id="selectSubscriptionApplyList" parameterType="SubscriptionApply" resultMap="SubscriptionApplyResult">
+        <include refid="selectSubscriptionApplyVo"/>
+        <where>
+            <if test="applyCustomName != null  and applyCustomName != ''"> and apply_custom_name like concat('%', #{applyCustomName}, '%')</if>
+            <if test="applyStatus != null "> and apply_status = #{applyStatus}</if>
+            <if test="applyDate != null "> and apply_date = #{applyDate}</if>
+        </where>
+    </select>
+    
+    <select id="selectSubscriptionApplyById" parameterType="String" resultMap="SubscriptionApplyResult">
+        <include refid="selectSubscriptionApplyVo"/>
+        where guid = #{guid}
+    </select>
+        
+    <insert id="insertSubscriptionApply" parameterType="SubscriptionApply">
+        insert into t_subscription_apply
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="guid != null  and guid != ''">guid,</if>
+            <if test="applyCustomerId != null  and applyCustomerId != ''">apply_customer_id,</if>
+            <if test="applyCustomName != null  and applyCustomName != ''">apply_custom_name,</if>
+            <if test="amount != null ">amount,</if>
+            <if test="remark != null  and remark != ''">remark,</if>
+            <if test="applyStatus != null ">apply_status,</if>
+            <if test="recordStatus != null ">record_status,</if>
+            <if test="applyDate != null  and applyDate != ''">apply_date,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="modifiedTime != null ">modified_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="guid != null  and guid != ''">#{guid},</if>
+            <if test="applyCustomerId != null  and applyCustomerId != ''">#{applyCustomerId},</if>
+            <if test="applyCustomName != null  and applyCustomName != ''">#{applyCustomName},</if>
+            <if test="amount != null ">#{amount},</if>
+            <if test="remark != null  and remark != ''">#{remark},</if>
+            <if test="applyStatus != null ">#{applyStatus},</if>
+            <if test="recordStatus != null ">#{recordStatus},</if>
+            <if test="applyDate != null  and applyDate != ''">#{applyDate},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="modifiedTime != null ">#{modifiedTime},</if>
+         </trim>
+    </insert>
+
+    <!--更新申请状态即认购完成-->
+    <update id="updateSubscriptionApply" parameterType="SubscriptionApply">
+        update t_subscription_apply
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="applyStatus != null ">apply_status = #{applyStatus},</if>
+            <if test="modifiedTime != null ">modified_time = #{modifiedTime},</if>
+        </trim>
+        where guid = #{guid}
+    </update>
+
+    <!-- 逻辑删除 -->
+    <delete id="deleteSubscriptionApplyById" parameterType="String">
+        update t_subscription_apply set record_status = 0 where guid = #{guid}
+    </delete>
+    <!-- 批量逻辑删除 -->
+    <delete id="deleteSubscriptionApplyByIds" parameterType="String">
+        update t_subscription_apply set record_status = 0 where guid in
+        <foreach item="guid" collection="array" open="(" separator="," close=")">
+            #{guid}
+        </foreach>
+    </delete>
+    
+</mapper>