|
@@ -1,108 +1,169 @@
|
|
|
<?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.iamberry.wechat.service.mapper.ChannelRebateMapper">
|
|
|
- <resultMap id="BaseResultMap" type="ChannelRebate" >
|
|
|
- <result column="rebate_id" property="rebateId" />
|
|
|
- <result column="rebate_sales_order_id" property="rebateSalesOrderId" />
|
|
|
- <result column="reback_from_open_id" property="rebackFromOpenId" />
|
|
|
- <result column="reback_channel_type" property="rebackChannelType" />
|
|
|
- <result column="reback_channel_id" property="rebackChannelId" />
|
|
|
- <result column="reback_amount" property="rebackAmount" />
|
|
|
- <result column="reback_status" property="rebackStatus" />
|
|
|
- <result column="reback_time" property="rebackTime" />
|
|
|
- <result column="reback_create_time" property="rebackCreateTime" />
|
|
|
- <result column="reback_update_time" property="rebackUpdateTime" />
|
|
|
+<mapper namespace="com.iamberry.wechat.service.mapper.ChildChannelMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="ChildChannel" >
|
|
|
+ <result column="child_channel_id" property="childChannelId" />
|
|
|
+ <result column="child_channel_open_id" property="childChannelOpenId" />
|
|
|
+ <result column="main_channel_id" property="mainChannelId" />
|
|
|
+ <result column="child_channel_name" property="childChannelName" />
|
|
|
+ <result column="child_channel_docking_name" property="childChannelDockingName" />
|
|
|
+ <result column="child_channel_docking_tel" property="childChannelDockingTel" />
|
|
|
+ <result column="child_channel_balance" property="childChannelBalance" />
|
|
|
+ <result column="child_channel_bank" property="childChannelBank" />
|
|
|
+ <result column="child_channel_bank_account" property="childChannelBankAccount" />
|
|
|
+ <result column="child_channel_bank_name" property="childChannelBankName" />
|
|
|
+ <result column="child_channel_bank_branch" property="childChannelBankBranch" />
|
|
|
+ <result column="child_channel_qrcode" property="childChannelQrcode" />
|
|
|
+ <result column="child_channel_status" property="childChannelStatus" />
|
|
|
+ <result column="child_channel_desc" property="childChannelDesc" />
|
|
|
+ <result column="child_channel_create_time" property="childChannelCreateTime" />
|
|
|
+ <result column="child_channel_update_time" property="childChannelUpdateTime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_List" >
|
|
|
- t.rebate_id,
|
|
|
- t.rebate_sales_order_id,
|
|
|
- t.reback_from_open_id,
|
|
|
- t.reback_channel_type,
|
|
|
- t.reback_channel_id,
|
|
|
- t.reback_amount,
|
|
|
- t.reback_status,
|
|
|
- t.reback_time,
|
|
|
- t.reback_create_time,
|
|
|
- t.reback_update_time
|
|
|
+ t.child_channel_id,
|
|
|
+ t.child_channel_open_id,
|
|
|
+ t.main_channel_id,
|
|
|
+ t.child_channel_name,
|
|
|
+ t.child_channel_docking_name,
|
|
|
+ t.child_channel_docking_tel,
|
|
|
+ t.child_channel_balance,
|
|
|
+ t.child_channel_bank,
|
|
|
+ t.child_channel_bank_account,
|
|
|
+ t.child_channel_bank_name,
|
|
|
+ t.child_channel_bank_branch,
|
|
|
+ t.child_channel_qrcode,
|
|
|
+ t.child_channel_status,
|
|
|
+ t.child_channel_desc,
|
|
|
+ t.child_channel_create_time,
|
|
|
+ t.child_channel_update_time
|
|
|
</sql>
|
|
|
- <select id="getChannelRebateList" resultMap="BaseResultMap" parameterType="ChannelRebate" >
|
|
|
+ <select id="getChildChannelList" resultMap="BaseResultMap" parameterType="ChildChannel" >
|
|
|
select
|
|
|
<include refid="Base_List" />
|
|
|
- from tb_iamberry_channel_rebate t
|
|
|
+ from tb_iamberry_child_channel t
|
|
|
<where>
|
|
|
- <if test="rebateId != null ">
|
|
|
- AND t.rebate_id = #{rebateId}
|
|
|
+ <if test="childChannelId != null ">
|
|
|
+ AND t.child_channel_id = #{childChannelId}
|
|
|
</if >
|
|
|
- <if test="rebateSalesOrderId != null and rebateSalesOrderId != ''">
|
|
|
- AND t.rebate_sales_order_id = #{rebateSalesOrderId}
|
|
|
+ <if test="childChannelOpenId != null and childChannelOpenId != ''">
|
|
|
+ AND t.child_channel_open_id = #{childChannelOpenId}
|
|
|
</if >
|
|
|
- <if test="rebackChannelType != null ">
|
|
|
- AND t.reback_channel_type = #{rebackChannelType}
|
|
|
+ <if test="mainChannelId != null ">
|
|
|
+ AND t.main_channel_id = #{mainChannelId}
|
|
|
</if >
|
|
|
- <if test="rebackChannelId != null ">
|
|
|
- AND t.reback_channel_id = #{rebackChannelId}
|
|
|
+ <if test="childChannelName != null and childChannelName != ''">
|
|
|
+ AND t.child_channel_name like CONCAT ('%',#{childChannelName},'%')
|
|
|
</if >
|
|
|
- <if test="rebackStatus != null ">
|
|
|
- AND t.reback_status = #{rebackStatus}
|
|
|
+ <if test="childChannelDockingName != null and childChannelDockingName != ''">
|
|
|
+ AND t.child_channel_docking_name like CONCAT ('%',#{childChannelDockingName},'%')
|
|
|
+ </if >
|
|
|
+ <if test="childChannelDockingTel != null and childChannelDockingTel != ''">
|
|
|
+ AND t.child_channel_docking_tel like CONCAT ('%',#{childChannelDockingTel},'%')
|
|
|
+ </if >
|
|
|
+ <if test="childChannelBalance != null ">
|
|
|
+ AND t.child_channel_balance = #{childChannelBalance}
|
|
|
+ </if >
|
|
|
+ <if test="childChannelBank != null and childChannelBank != ''">
|
|
|
+ AND t.child_channel_bank = #{childChannelBank}
|
|
|
+ </if >
|
|
|
+ <if test="childChannelBankAccount != null and childChannelBankAccount != ''">
|
|
|
+ AND t.child_channel_bank_account = #{childChannelBankAccount}
|
|
|
+ </if >
|
|
|
+ <if test="childChannelStatus != null ">
|
|
|
+ AND t.child_channel_status = #{childChannelStatus}
|
|
|
</if >
|
|
|
</where>
|
|
|
</select>
|
|
|
- <select id="getChannelRebateById" resultMap="BaseResultMap" parameterType="Integer" >
|
|
|
+ <select id="getChildChannelById" resultMap="BaseResultMap" parameterType="Integer" >
|
|
|
select
|
|
|
<include refid="Base_List" />
|
|
|
- from tb_iamberry_channel_rebate t
|
|
|
- where t.rebate_id= #{rebateId}
|
|
|
+ from tb_iamberry_child_channel t
|
|
|
+ where t.child_channel_id= #{childChannelId}
|
|
|
</select>
|
|
|
- <insert id="save" parameterType="ChannelRebate" >
|
|
|
+ <insert id="save" parameterType="ChildChannel" >
|
|
|
insert into
|
|
|
- tb_iamberry_channel_rebate
|
|
|
+ tb_iamberry_child_channel
|
|
|
(
|
|
|
- rebate_sales_order_id,
|
|
|
- reback_from_open_id,
|
|
|
- reback_channel_type,
|
|
|
- reback_channel_id,
|
|
|
- reback_amount,
|
|
|
- reback_status,
|
|
|
- reback_time
|
|
|
+ child_channel_open_id,
|
|
|
+ main_channel_id,
|
|
|
+ child_channel_name,
|
|
|
+ child_channel_docking_name,
|
|
|
+ child_channel_docking_tel,
|
|
|
+ child_channel_balance,
|
|
|
+ child_channel_bank,
|
|
|
+ child_channel_bank_account,
|
|
|
+ child_channel_bank_name,
|
|
|
+ child_channel_bank_branch,
|
|
|
+ child_channel_qrcode,
|
|
|
+ child_channel_status,
|
|
|
+ child_channel_desc
|
|
|
)
|
|
|
values
|
|
|
(
|
|
|
- #{rebateSalesOrderId},
|
|
|
- #{rebackFromOpenId},
|
|
|
- #{rebackChannelType},
|
|
|
- #{rebackChannelId},
|
|
|
- #{rebackAmount},
|
|
|
- #{rebackStatus},
|
|
|
- #{rebackTime}
|
|
|
+ #{childChannelOpenId},
|
|
|
+ #{mainChannelId},
|
|
|
+ #{childChannelName},
|
|
|
+ #{childChannelDockingName},
|
|
|
+ #{childChannelDockingTel},
|
|
|
+ #{childChannelBalance},
|
|
|
+ #{childChannelBank},
|
|
|
+ #{childChannelBankAccount},
|
|
|
+ #{childChannelBankName},
|
|
|
+ #{childChannelBankBranch},
|
|
|
+ #{childChannelQrcode},
|
|
|
+ #{childChannelStatus},
|
|
|
+ #{childChannelDesc}
|
|
|
)
|
|
|
</insert>
|
|
|
- <update id="update" parameterType="ChannelRebate" >
|
|
|
+ <update id="update" parameterType="ChildChannel" >
|
|
|
update
|
|
|
- tb_iamberry_channel_rebate
|
|
|
+ tb_iamberry_child_channel
|
|
|
<set >
|
|
|
- <if test="rebateSalesOrderId != null and rebateSalesOrderId != ''">
|
|
|
- rebate_sales_order_id = #{rebateSalesOrderId},
|
|
|
+ <if test="childChannelOpenId != null and childChannelOpenId != ''">
|
|
|
+ child_channel_open_id = #{childChannelOpenId},
|
|
|
+ </if >
|
|
|
+ <if test="mainChannelId != null ">
|
|
|
+ main_channel_id = #{mainChannelId},
|
|
|
+ </if >
|
|
|
+ <if test="childChannelName != null and childChannelName != ''">
|
|
|
+ child_channel_name = #{childChannelName},
|
|
|
+ </if >
|
|
|
+ <if test="childChannelDockingName != null and childChannelDockingName != ''">
|
|
|
+ child_channel_docking_name = #{childChannelDockingName},
|
|
|
+ </if >
|
|
|
+ <if test="childChannelDockingTel != null and childChannelDockingTel != ''">
|
|
|
+ child_channel_docking_tel = #{childChannelDockingTel},
|
|
|
+ </if >
|
|
|
+ <if test="childChannelBalance != null ">
|
|
|
+ child_channel_balance = #{childChannelBalance},
|
|
|
+ </if >
|
|
|
+ <if test="childChannelBank != null and childChannelBank != ''">
|
|
|
+ child_channel_bank = #{childChannelBank},
|
|
|
</if >
|
|
|
- <if test="rebackFromOpenId != null and rebackFromOpenId != ''">
|
|
|
- reback_from_open_id = #{rebackFromOpenId},
|
|
|
+ <if test="childChannelBankAccount != null and childChannelBankAccount != ''">
|
|
|
+ child_channel_bank_account = #{childChannelBankAccount},
|
|
|
</if >
|
|
|
- <if test="rebackChannelType != null ">
|
|
|
- reback_channel_type = #{rebackChannelType},
|
|
|
+ <if test="childChannelBankName != null and childChannelBankName != ''">
|
|
|
+ child_channel_bank_name = #{childChannelBankName},
|
|
|
</if >
|
|
|
- <if test="rebackChannelId != null ">
|
|
|
- reback_channel_id = #{rebackChannelId},
|
|
|
+ <if test="childChannelBankBranch != null and childChannelBankBranch != ''">
|
|
|
+ child_channel_bank_branch = #{childChannelBankBranch},
|
|
|
</if >
|
|
|
- <if test="rebackAmount != null ">
|
|
|
- reback_amount = #{rebackAmount},
|
|
|
+ <if test="childChannelQrcode != null and childChannelQrcode != ''">
|
|
|
+ child_channel_qrcode = #{childChannelQrcode},
|
|
|
</if >
|
|
|
- <if test="rebackStatus != null ">
|
|
|
- reback_status = #{rebackStatus},
|
|
|
+ <if test="childChannelStatus != null ">
|
|
|
+ child_channel_status = #{childChannelStatus},
|
|
|
</if >
|
|
|
- <if test="rebackTime != null and rebackTime != ''">
|
|
|
- reback_time = #{rebackTime},
|
|
|
+ <if test="childChannelDesc != null and childChannelDesc != ''">
|
|
|
+ child_channel_desc = #{childChannelDesc},
|
|
|
</if >
|
|
|
</set >
|
|
|
- where rebate_id= #{rebateId}
|
|
|
+ where child_channel_id= #{childChannelId}
|
|
|
</update>
|
|
|
-
|
|
|
+ <delete id="delete" parameterType="Integer" >
|
|
|
+ delete
|
|
|
+ tb_iamberry_child_channel
|
|
|
+ where child_channel_id=#{childChannelId}
|
|
|
+ </delete>
|
|
|
</mapper>
|