XH-Power-Cloud/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcStationInternetBlacklistMapper.xml

53 lines
2.1 KiB
XML
Raw Normal View History

<?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.xhpc.user.mapper.XhpcStationInternetBlacklistMapper">
<resultMap type="com.xhpc.user.domain.XhpcStationInternetBlacklist" id="XhpcStationInternetBlacklistResult">
<result column="internet_user_id" property="internetUserId"/>
<result column="charging_station_id" property="chargingStationId"/>
</resultMap>
<insert id="insert" parameterType="com.xhpc.user.domain.XhpcInternetUser">
insert into xhpc_operator_internet_blacklist(
<if test="null != internetUserId and '' != internetUserId">
internet_user_id,
</if>
<if test="null != chargingStationId and '' != chargingStationId">
charging_station_id
</if>
)values(
<if test="null != internetUserId and '' != internetUserId">
#{internetUserId},
</if>
<if test="null != chargingStationId and '' != chargingStationId">
#{chargingStationId}
</if>
</insert>
<delete id="deleteByIds" parameterType="java.lang.Long">
delete from xhpc_station_internet_blacklist where internet_user_id = #{internetUserId}
</delete>
<select id="list" parameterType="java.lang.Long" resultType="java.util.Map">
select
internet_user_id internetUserId, charging_station_id chargingStationId
from xhpc_station_internet_blacklist
WHERE 1 = 1
<if test="internetUserId != null and internetUserId != ''">
and internet_user_id = #{internetUserId}
</if>
</select>
<select id="getXhpcChargingStation" parameterType="java.lang.Long" resultType="java.util.Map">
select
charging_station_id chargingStationId, `name `,operator_id operatorId
from xhpc_charging_station
WHERE del_flag = 0
<if test="operatorId != null and operatorId != ''">
and operator_id = #{operatorId}
</if>
</select>
</mapper>