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

183 lines
7.1 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.TerminalSchedulesTempDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
<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="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="request_id" jdbcType="INTEGER" property="requestId"/>
<result column="offset" jdbcType="INTEGER" property="offset"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<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, schedule_id,request_id, status,create_time, update_time
</sql>
<select id="selectByTermAndChannel" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_temp
where status = #{status}
<if test="list != null and list.size>0">
and
<foreach collection="list" item="item" index="index" open="(" close=")" separator="or">
term_id = #{item.termid}
<if test="item.channelidlist != null and item.channelidlist.size>0">
and channel_id in
<foreach collection="item.channelidlist" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</foreach>
</if>
</select>
<select id="selectByRequestId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_temp
where status = #{status}
<if test="list != null and list.size>0">
and request_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_temp
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedule_temp
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedule_temp (id, term_id, channel_id,
schedule_id, create_time, update_time
)
values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER},
#{scheduleId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertList" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedule_temp
(term_id, channel_id,
schedule_id, request_id,status,create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{item.scheduleId},#{item.requestId},#{status},#{createat},#{updateat})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedule_temp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="scheduleId != null">
schedule_id,
</if>
<if test="requestId != null">
request_id,
</if>
<if test="status != null">
status,
</if>
<if test="offset != null">
offset,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
#{scheduleId,jdbcType=INTEGER},
</if>
<if test="requestId != null">
#{requestId},
</if>
<if test="status != null">
#{status},
</if>
<if test="offset != null">
#{offset},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateStatusByRequestIdList">
update terminal_schedule_temp
<set>
<if test="status != null">
status = #{status},
</if>
<if test="updateat != null">
update_time = #{updateat},
</if>
</set>
<if test="list != null and list.size>0">
where request_id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
update terminal_schedule_temp
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
schedule_id = #{scheduleId,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.TerminalSchedulesTemp">
update terminal_schedule_temp
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER},
schedule_id = #{scheduleId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>