Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/StationSplitConfigMapper.xml
YAS\29473 bc7fa82f71 update
2025-04-14 12:14:15 +08:00

74 lines
3.4 KiB
XML

<?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.jsowell.pile.mapper.StationSplitConfigMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.StationSplitConfig">
<!--@mbg.generated-->
<!--@Table station_split_config-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="station_id" jdbcType="VARCHAR" property="stationId" />
<result column="adapay_member_id" jdbcType="VARCHAR" property="adapayMemberId" />
<result column="electricity_split_ratio" jdbcType="DECIMAL" property="electricitySplitRatio" />
<result column="service_split_ratio" jdbcType="DECIMAL" property="serviceSplitRatio" />
<result column="fee_flag" jdbcType="VARCHAR" property="feeFlag" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="CHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, merchant_id, station_id, adapay_member_id, electricity_split_ratio, service_split_ratio, fee_flag,
create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="queryByStationId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from station_split_config
where del_flag = '0'
and station_id = #{stationId}
order by fee_flag
</select>
<select id="queryStationList" resultType="com.jsowell.pile.vo.web.SplitConfigStationVO">
select
t2.id as stationId,
t2.station_name as stationName
from station_split_config t1
left join pile_station_info t2 on t1.station_id = t2.id
where t1.adapay_member_id = #{adapayMemberId}
</select>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into station_split_config
(id, merchant_id, station_id, adapay_member_id, electricity_split_ratio, service_split_ratio, fee_flag,
create_by, create_time, update_by, update_time, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=INTEGER}, #{item.merchantId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR},
#{item.adapayMemberId,jdbcType=VARCHAR}, #{item.electricitySplitRatio,jdbcType=DECIMAL},
#{item.serviceSplitRatio,jdbcType=DECIMAL}, #{item.feeFlag,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=CHAR})
</foreach>
</insert>
<update id="deleteByMerchantIdAndStationId">
update station_split_config
set del_flag = '1', update_by = #{updateBy}, update_time = #{updateTime}
where del_flag = '0'
and merchant_id = #{merchantId}
and station_id = #{stationId}
</update>
<update id="deleteByStationId">
update station_split_config
set del_flag = '1', update_by = #{updateBy}, update_time = #{updateTime}
where del_flag = '0'
and station_id = #{stationId}
</update>
</mapper>