You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
backend/xymanager_dao/src/main/resources/mappers/TerminalChannelMapperDao.xml

137 lines
5.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.shxy.xymanager_dao.dao.TerminalChannelMapperDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalChannelMapper">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="alias" jdbcType="VARCHAR" property="alias"/>
<result column="photo_id" jdbcType="BIGINT" property="photoId"/>
<result column="photo_time" jdbcType="BIGINT" property="photoTime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id,alias, photo_id,photo_time,create_time, update_time
</sql>
<select id="selectByTermid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
</select>
2 years ago
<select id="selectByTermidAndChannelid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
where term_id = #{termid} and channel_id = #{channelid}
</select>
<select id="selectAllByPhotoTime" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
<if test="time != null">
where photo_time > #{time}
</if>
group by term_id,channel_id
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
where id = #{id,jdbcType=INTEGER}
</select>
2 years ago
<delete id="deleteByTermId" parameterType="java.lang.Integer">
delete from terminal_channel_mapper
2 years ago
where term_id = #{id}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
insert into terminal_channel_mapper (id, term_id, channel_id,
create_time, update_time)
values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
insert into terminal_channel_mapper
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<insert id="insertList" parameterType="java.util.List">
insert into terminal_channel_mapper
(term_id, channel_id,alias,
create_time, update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{item.alias},#{createat},#{updateat})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
update terminal_channel_mapper
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
update terminal_channel_mapper
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>