2023-06-06 08:57:30 +08:00
|
|
|
<?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">
|
2023-07-07 14:40:19 +08:00
|
|
|
<mapper namespace="com.jsowell.pile.mapper.ThirdPartyStationRelationMapper">
|
|
|
|
|
<resultMap type="com.jsowell.pile.domain.ThirdPartyStationRelation" id="ThirdPartyStationRelationResult">
|
2024-04-08 15:26:18 +08:00
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
<result property="stationId" column="station_id"/>
|
|
|
|
|
<result property="thirdPartyType" column="third_party_type"/>
|
|
|
|
|
<result property="startMode" column="start_mode"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
|
<result property="delFlag" column="del_flag"/>
|
2023-06-06 08:57:30 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
2024-04-08 15:26:18 +08:00
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
id,
|
|
|
|
|
station_id,
|
|
|
|
|
third_party_type,
|
|
|
|
|
start_mode,
|
|
|
|
|
create_time,
|
|
|
|
|
create_by,
|
|
|
|
|
update_time,
|
|
|
|
|
update_by,
|
|
|
|
|
del_flag
|
2023-06-06 08:57:30 +08:00
|
|
|
</sql>
|
|
|
|
|
|
2024-04-29 17:24:16 +08:00
|
|
|
<sql id="selectThirdPartyStationRelationVo">
|
|
|
|
|
select <include refid="Base_Column_List"/>
|
|
|
|
|
from thirdparty_station_relation
|
|
|
|
|
</sql>
|
|
|
|
|
|
2024-04-08 15:26:18 +08:00
|
|
|
<select id="selectThirdPartyStationRelationList" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation"
|
|
|
|
|
resultMap="ThirdPartyStationRelationResult">
|
2023-07-07 14:40:19 +08:00
|
|
|
<include refid="selectThirdPartyStationRelationVo"/>
|
2024-01-17 17:13:55 +08:00
|
|
|
where del_flag = '0'
|
2024-04-08 15:26:18 +08:00
|
|
|
<if test="stationId != null">
|
|
|
|
|
and station_id = #{stationId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null and thirdPartyType != ''">
|
|
|
|
|
and third_party_type = #{thirdPartyType}
|
|
|
|
|
</if>
|
2023-06-06 08:57:30 +08:00
|
|
|
</select>
|
|
|
|
|
|
2023-07-07 14:40:19 +08:00
|
|
|
<select id="selectThirdPartyStationRelationById" parameterType="Long" resultMap="ThirdPartyStationRelationResult">
|
|
|
|
|
<include refid="selectThirdPartyStationRelationVo"/>
|
2023-06-06 08:57:30 +08:00
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-04-08 15:26:18 +08:00
|
|
|
<insert id="insertThirdPartyStationRelation" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation"
|
|
|
|
|
useGeneratedKeys="true" keyProperty="id">
|
2023-07-07 14:40:19 +08:00
|
|
|
insert into thirdparty_station_relation
|
2023-06-06 08:57:30 +08:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
2024-04-08 15:26:18 +08:00
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null">
|
|
|
|
|
third_party_type,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startMode != null">
|
|
|
|
|
start_mode,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag,
|
|
|
|
|
</if>
|
2023-06-06 08:57:30 +08:00
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
2024-04-08 15:26:18 +08:00
|
|
|
<if test="stationId != null">
|
|
|
|
|
#{stationId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null">
|
|
|
|
|
#{thirdPartyType},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startMode != null">
|
|
|
|
|
#{startMode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
#{createBy},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
#{updateTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
#{updateBy},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
#{delFlag},
|
|
|
|
|
</if>
|
2023-06-06 08:57:30 +08:00
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
2023-07-07 14:40:19 +08:00
|
|
|
<update id="updateThirdPartyStationRelation" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation">
|
|
|
|
|
update thirdparty_station_relation
|
2023-06-06 08:57:30 +08:00
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
2024-04-08 15:26:18 +08:00
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id = #{stationId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null">
|
|
|
|
|
third_party_type = #{thirdPartyType},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startMode != null">
|
|
|
|
|
start_mode = #{startMode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by = #{createBy},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by = #{updateBy},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag = #{delFlag},
|
|
|
|
|
</if>
|
2023-06-06 08:57:30 +08:00
|
|
|
</trim>
|
2023-06-06 10:54:29 +08:00
|
|
|
where station_id = #{stationId,jdbcType=BIGINT}
|
2023-06-06 08:57:30 +08:00
|
|
|
</update>
|
|
|
|
|
|
2023-07-07 14:40:19 +08:00
|
|
|
<delete id="deleteThirdPartyStationRelationById" parameterType="Long">
|
2024-04-08 15:26:18 +08:00
|
|
|
delete
|
|
|
|
|
from thirdparty_station_relation
|
|
|
|
|
where id = #{id}
|
2023-06-06 08:57:30 +08:00
|
|
|
</delete>
|
|
|
|
|
|
2023-07-07 14:40:19 +08:00
|
|
|
<delete id="deleteThirdPartyStationRelationByIds" parameterType="String">
|
2024-04-08 15:26:18 +08:00
|
|
|
delete
|
|
|
|
|
from thirdparty_station_relation where id in
|
2023-06-06 08:57:30 +08:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
2024-04-29 17:24:16 +08:00
|
|
|
<delete id="deleteThirdPartyStationRelationByStationId">
|
|
|
|
|
delete
|
|
|
|
|
from thirdparty_station_relation
|
|
|
|
|
where station_id = #{stationId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into thirdparty_station_relation
|
|
|
|
|
(station_id, third_party_type, start_mode, create_time, create_by, update_time, update_by,
|
|
|
|
|
del_flag)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.stationId,jdbcType=INTEGER}, #{item.thirdPartyType,jdbcType=VARCHAR}, #{item.startMode,jdbcType=VARCHAR},
|
|
|
|
|
#{item.createTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{item.updateBy,jdbcType=VARCHAR}, #{item.delFlag,jdbcType=CHAR})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
2023-07-07 14:40:19 +08:00
|
|
|
<select id="selectRelationInfo" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
2024-04-08 15:26:18 +08:00
|
|
|
select t1.station_id as stationId,
|
|
|
|
|
t1.third_party_type as thirdPartyType,
|
|
|
|
|
t1.start_mode as startMode,
|
|
|
|
|
t2.url_address as urlAddress,
|
|
|
|
|
t2.operator_id as operatorId,
|
|
|
|
|
t2.operator_secret as operatorSecret,
|
|
|
|
|
t2.sign_secret as signSecret,
|
|
|
|
|
t2.data_secret as dataSecret,
|
|
|
|
|
t2.data_secret_IV as dataSecretIv
|
|
|
|
|
from thirdparty_station_relation t1
|
|
|
|
|
join thirdparty_setting_info t2 on t1.third_party_type = t2.type
|
2023-06-06 08:57:30 +08:00
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
and t1.station_id = #{stationId,jdbcType=BIGINT}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null and thirdPartyType != ''">
|
|
|
|
|
and t1.third_party_type = #{thirdPartyType,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
2024-01-18 17:03:08 +08:00
|
|
|
|
|
|
|
|
<select id="getRelationInfoList" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
2024-04-08 15:26:18 +08:00
|
|
|
select t1.station_id as stationId,
|
|
|
|
|
t1.third_party_type as thirdPartyType,
|
|
|
|
|
t1.start_mode as startMode,
|
|
|
|
|
t2.url_address as urlAddress,
|
|
|
|
|
t2.operator_id as operatorId,
|
|
|
|
|
t2.operator_secret as operatorSecret,
|
|
|
|
|
t2.sign_secret as signSecret,
|
|
|
|
|
t2.data_secret as dataSecret,
|
|
|
|
|
t2.data_secret_IV as dataSecretIv
|
|
|
|
|
from thirdparty_station_relation t1
|
2024-07-30 14:52:12 +08:00
|
|
|
join thirdparty_setting_info t2 on t1.third_party_type = t2.type
|
2024-01-18 17:03:08 +08:00
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
and t1.station_id = #{stationId,jdbcType=BIGINT}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateRelationDelFlag">
|
|
|
|
|
update
|
|
|
|
|
thirdparty_station_relation
|
2024-04-08 15:26:18 +08:00
|
|
|
set del_flag = '1'
|
|
|
|
|
where station_id = #{stationId,jdbcType=VARCHAR}
|
|
|
|
|
and third_party_type in
|
2024-01-19 11:43:20 +08:00
|
|
|
<foreach collection="types" open="(" item="type" close=")" separator=",">
|
|
|
|
|
#{type,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
2024-01-18 17:03:08 +08:00
|
|
|
</update>
|
2024-04-15 17:02:50 +08:00
|
|
|
|
|
|
|
|
<select id="selectMerchantList" resultType="com.jsowell.pile.vo.base.MerchantInfoVO">
|
|
|
|
|
select
|
|
|
|
|
t3.id as merchantId,
|
|
|
|
|
t3.merchant_name as merchantName,
|
|
|
|
|
t3.service_phone as merchantTel,
|
|
|
|
|
t3.organization_code as organizationCode,
|
|
|
|
|
t3.dept_id as deptId,
|
|
|
|
|
t3.merchant_level as merchantLevel,
|
|
|
|
|
t3.address as merchantAddress
|
|
|
|
|
from
|
|
|
|
|
thirdparty_station_relation t1
|
|
|
|
|
join pile_station_info t2 on t2.id = t1.station_id and t2.del_flag = '0'
|
|
|
|
|
join pile_merchant_info t3 on t3.id = t2.merchant_id and t3.del_flag = '0'
|
|
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
and t1.third_party_type = #{thirdPlatformType,jdbcType=VARCHAR}
|
|
|
|
|
GROUP BY t3.id
|
|
|
|
|
</select>
|
2024-04-24 17:08:14 +08:00
|
|
|
|
|
|
|
|
<select id="selectStationList" resultType="com.jsowell.pile.vo.base.StationInfoVO">
|
|
|
|
|
select
|
|
|
|
|
t1.station_id as stationId,
|
|
|
|
|
t2.station_name as stationName
|
|
|
|
|
from thirdparty_station_relation t1
|
|
|
|
|
join pile_station_info t2 on t2.id = t1.station_id and t2.del_flag = '0'
|
|
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
and t1.third_party_type = #{thirdPlatformType,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2024-04-29 17:24:16 +08:00
|
|
|
|
|
|
|
|
<select id="selectRelationListByStationId" resultMap="ThirdPartyStationRelationResult">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from thirdparty_station_relation
|
|
|
|
|
where station_id = #{stationId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.ThirdPartyStationRelation" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into thirdparty_station_relation
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null">
|
|
|
|
|
third_party_type,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startMode != null">
|
|
|
|
|
start_mode,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
values
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
#{stationId,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null">
|
|
|
|
|
#{thirdPartyType,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startMode != null">
|
|
|
|
|
#{startMode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
#{delFlag,jdbcType=CHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id = #{stationId,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdPartyType != null">
|
|
|
|
|
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startMode != null">
|
|
|
|
|
start_mode = #{startMode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">
|
|
|
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">
|
|
|
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag = #{delFlag,jdbcType=CHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
2025-02-12 08:57:57 +08:00
|
|
|
<select id="getRelationInfoListV2" resultType="com.jsowell.pile.vo.base.ThirdPartyStationRelationVO">
|
|
|
|
|
SELECT
|
|
|
|
|
t1.station_id AS stationId,
|
|
|
|
|
t1.third_party_type AS thirdPartyType,
|
|
|
|
|
t2.platform_name AS thirdPartyName,
|
|
|
|
|
t2.start_mode AS startMode,
|
|
|
|
|
t2.url_prefix AS urlAddress,
|
|
|
|
|
t2.their_operator_id AS theirOperatorId,
|
|
|
|
|
t2.their_operator_secret AS theirOperatorSecret,
|
|
|
|
|
t2.their_sig_secret AS theirSignSecret,
|
|
|
|
|
t2.their_data_secret AS theirDataSecret,
|
|
|
|
|
t2.their_data_secret_iv AS theirDataSecretIv,
|
|
|
|
|
t2.our_operator_secret AS ourOperatorSecret,
|
|
|
|
|
t2.our_sig_secret AS ourSignSecret,
|
|
|
|
|
t2.our_data_secret AS ourDataSecret,
|
|
|
|
|
t2.our_data_secret_iv AS ourDataSecretIv
|
|
|
|
|
FROM
|
|
|
|
|
thirdparty_station_relation t1
|
|
|
|
|
JOIN thirdparty_secret_info t2 ON t1.third_party_type = t2.platform_type
|
|
|
|
|
where t1.del_flag = '0'
|
|
|
|
|
and t1.station_id = #{stationId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2023-06-06 08:57:30 +08:00
|
|
|
</mapper>
|