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/TerminalPhotoDao.xml

184 lines
7.3 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.TerminalPhotoDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalPhoto">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="preset_id" jdbcType="INTEGER" property="presetId"/>
<result column="width" jdbcType="INTEGER" property="width"/>
<result column="height" jdbcType="INTEGER" property="height"/>
<result column="file_size" jdbcType="INTEGER" property="fileSize"/>
<result column="photo_time" jdbcType="BIGINT" property="photoTime"/>
<result column="recv_time" jdbcType="BIGINT" property="recvTime"/>
<result column="path" jdbcType="VARCHAR" property="path"/>
<result column="manual_request" jdbcType="TINYINT" property="manualRequest"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time,
path, manual_request, create_time
</sql>
<select id="selectPhotoList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where term_id = #{terminalid} and channel_id = #{channelid} and photo_time between #{starttime} and #{endtime}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from terminal_photos
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto">
insert into terminal_photos (id, term_id, channel_id,
preset_id, width, height,
file_size, photo_time, recv_time,
path, manual_request, create_time
)
values (#{id,jdbcType=BIGINT}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER},
#{presetId,jdbcType=TINYINT}, #{width,jdbcType=INTEGER}, #{height,jdbcType=INTEGER},
#{fileSize,jdbcType=INTEGER}, #{photoTime,jdbcType=TIMESTAMP}, #{recvTime,jdbcType=TIMESTAMP},
#{path,jdbcType=VARCHAR}, #{manualRequest,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto">
insert into terminal_photos
<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="presetId != null">
preset_id,
</if>
<if test="width != null">
width,
</if>
<if test="height != null">
height,
</if>
<if test="fileSize != null">
file_size,
</if>
<if test="photoTime != null">
photo_time,
</if>
<if test="recvTime != null">
recv_time,
</if>
<if test="path != null">
path,
</if>
<if test="manualRequest != null">
manual_request,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="presetId != null">
#{presetId,jdbcType=TINYINT},
</if>
<if test="width != null">
#{width,jdbcType=INTEGER},
</if>
<if test="height != null">
#{height,jdbcType=INTEGER},
</if>
<if test="fileSize != null">
#{fileSize,jdbcType=INTEGER},
</if>
<if test="photoTime != null">
#{photoTime,jdbcType=TIMESTAMP},
</if>
<if test="recvTime != null">
#{recvTime,jdbcType=TIMESTAMP},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="manualRequest != null">
#{manualRequest,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto">
update terminal_photos
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="presetId != null">
preset_id = #{presetId,jdbcType=TINYINT},
</if>
<if test="width != null">
width = #{width,jdbcType=INTEGER},
</if>
<if test="height != null">
height = #{height,jdbcType=INTEGER},
</if>
<if test="fileSize != null">
file_size = #{fileSize,jdbcType=INTEGER},
</if>
<if test="photoTime != null">
photo_time = #{photoTime,jdbcType=TIMESTAMP},
</if>
<if test="recvTime != null">
recv_time = #{recvTime,jdbcType=TIMESTAMP},
</if>
<if test="path != null">
path = #{path,jdbcType=VARCHAR},
</if>
<if test="manualRequest != null">
manual_request = #{manualRequest,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto">
update terminal_photos
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER},
preset_id = #{presetId,jdbcType=TINYINT},
width = #{width,jdbcType=INTEGER},
height = #{height,jdbcType=INTEGER},
file_size = #{fileSize,jdbcType=INTEGER},
photo_time = #{photoTime,jdbcType=TIMESTAMP},
recv_time = #{recvTime,jdbcType=TIMESTAMP},
path = #{path,jdbcType=VARCHAR},
manual_request = #{manualRequest,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>