update 移动充电桩到另一个站点 接口

This commit is contained in:
Lemon
2025-10-30 16:10:05 +08:00
parent 5df6dd9d20
commit 49e31d2794
3 changed files with 31 additions and 3 deletions

View File

@@ -237,8 +237,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="replaceMerchantStationByPileIds">
update pile_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="newMerchantId != null">merchant_id = #{newMerchantId},</if>
<if test="newStationId != null">station_id = #{newStationId},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="chargerPileType != null">
business_type = #{chargerPileType,jdbcType=VARCHAR},
</if>
@@ -476,4 +476,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
t1.station_id = #{stationId,jdbcType=VARCHAR}
</select>
<select id="movePile2AnotherStation" resultType="int">
update pile_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="newMerchantId != null">merchant_id = #{newMerchantId},</if>
<if test="newStationId != null">station_id = #{newStationId},</if>
<if test="chargerPileType != null">
business_type = #{chargerPileType,jdbcType=VARCHAR},
</if>
<if test="chargerPileType == '1'.toString() "> secret_key = null,</if>
<if test="chargerPileType == '2'.toString() "> secret_key = substring(uuid(), 1, 8),</if>
<if test="modelId != null">model_id = #{modelId},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id in
<foreach collection="pileIdList" item="pileId" open="(" separator="," close=")">
#{pileId,jdbcType=BIGINT}
</foreach>
</select>
</mapper>