XH-Power-Cloud/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcStationInternetBlacklistMapper.xml
2021-07-22 16:02:30 +08:00

105 lines
3.9 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.xhpc.user.mapper.XhpcStationInternetBlacklistMapper">
<resultMap type="com.xhpc.user.domain.XhpcStationInternetBlacklist" id="XhpcStationInternetBlacklistResult">
<result column="xhpc_user_privilege_id" property="xhpcUserPrivilegeId" />
<result column="user_id" property="userId" />
<result column="charging_station_id" property="chargingStationId" />
<result column="status" property="status" />
<result column="create_time" property="createTime" />
<result column="create_by" property="createBy" />
<result column="update_time" property="updateTime" />
<result column="update_by" property="updateBy" />
<result column="remark" property="remark" />
</resultMap>
<insert id="insert" parameterType="com.xhpc.user.domain.XhpcInternetUser">
insert into xhpc_operator_internet_blacklist
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != xhpcUserPrivilegeId and '' != xhpcUserPrivilegeId">
xhpc_user_privilege_id,
</if>
<if test="null != userId and '' != userId">
user_id,
</if>
<if test="null != chargingStationId and '' != chargingStationId">
charging_station_id,
</if>
<if test="null != status and '' != status">
status,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != xhpcUserPrivilegeId and '' != xhpcUserPrivilegeId">
#{xhpcUserPrivilegeId},
</if>
<if test="null != userId and '' != userId">
#{userId},
</if>
<if test="null != chargingStationId and '' != chargingStationId">
#{chargingStationId},
</if>
<if test="null != status and '' != status">
#{status},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark}
</if>
</trim>
</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>