济菏高速数据中心代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

73 lines
3.2 KiB

<?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.zc.business.mapper.DcExternalPlatformOfflineMapper">
<resultMap type="DcExternalPlatformOffline" id="DcExternalPlatformOfflineResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="offlineTime" column="offline_time" />
<result property="endTime" column="end_time" />
</resultMap>
<sql id="selectDcExternalPlatformOfflineVo">
select id, type, offline_time, end_time from dc_external_platform_offline
</sql>
<select id="selectDcExternalPlatformOfflineList" parameterType="DcExternalPlatformOffline" resultMap="DcExternalPlatformOfflineResult">
<include refid="selectDcExternalPlatformOfflineVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="offlineTime != null ">
and date_format(offline_time,'%Y-%m-%d') &lt;= date_format(#{offlineTime},'%Y-%m-%d')
and (date_format(end_time,'%Y-%m-%d') >= date_format(#{offlineTime},'%Y-%m-%d') or isnull(end_time))
</if>
</where>
order by id desc
</select>
<select id="selectDcExternalPlatformOfflineById" parameterType="Long" resultMap="DcExternalPlatformOfflineResult">
<include refid="selectDcExternalPlatformOfflineVo"/>
where id = #{id}
</select>
<insert id="insertDcExternalPlatformOffline" parameterType="DcExternalPlatformOffline" useGeneratedKeys="true" keyProperty="id">
insert into dc_external_platform_offline
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="offlineTime != null">offline_time,</if>
<if test="endTime != null">end_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="offlineTime != null">#{offlineTime},</if>
<if test="endTime != null">#{endTime},</if>
</trim>
</insert>
<update id="updateDcExternalPlatformOffline" parameterType="DcExternalPlatformOffline">
update dc_external_platform_offline
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="offlineTime != null">offline_time = #{offlineTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
</trim>
where id = #{id}
</update>
<update id="updateEndTimeByType">
update dc_external_platform_offline set end_time = now()
where isnull(end_time) and type = #{type}
</update>
<delete id="deleteDcExternalPlatformOfflineById" parameterType="Long">
delete from dc_external_platform_offline where id = #{id}
</delete>
<delete id="deleteDcExternalPlatformOfflineByIds" parameterType="String">
delete from dc_external_platform_offline where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>