济菏高速数据中心代码
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.
 
 
 
 
 

79 lines
3.5 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.DcRoadConditionInformationMapper">
<resultMap type="com.zc.business.domain.DcRoadConditionInformation" id="DcRoadConditionInformationResult">
<result property="id" column="id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="otherConfig" column="other_config" />
</resultMap>
<sql id="selectDcRoadConditionInformationVo">
select id, create_time, update_time, other_config from dc_road_condition_information
</sql>
<select id="selectDcRoadConditionInformationList" parameterType="DcRoadConditionInformation" resultMap="DcRoadConditionInformationResult">
<include refid="selectDcRoadConditionInformationVo"/>
<where>
<if test="otherConfig != null and otherConfig != ''"> and other_config = #{otherConfig}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectlistTime" parameterType="DcRoadConditionInformation" resultMap="DcRoadConditionInformationResult">
SELECT id, create_time, update_time, other_config
FROM (
SELECT id, create_time, update_time, other_config
FROM dc_road_condition_information
WHERE DATE(create_time) = CURDATE()
ORDER BY create_time DESC
LIMIT 10
) AS subquery
ORDER BY create_time ASC;
</select>
<select id="selectDcRoadConditionInformationById" parameterType="Long" resultMap="DcRoadConditionInformationResult">
<include refid="selectDcRoadConditionInformationVo"/>
where id = #{id}
</select>
<insert id="insertDcRoadConditionInformation" parameterType="DcRoadConditionInformation">
insert into dc_road_condition_information
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="otherConfig != null">other_config,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="otherConfig != null">#{otherConfig},</if>
</trim>
</insert>
<update id="updateDcRoadConditionInformation" parameterType="DcRoadConditionInformation">
update dc_road_condition_information
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="otherConfig != null">other_config = #{otherConfig},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcRoadConditionInformationById" parameterType="Long">
delete from dc_road_condition_information where id = #{id}
</delete>
<delete id="deleteDcRoadConditionInformationByIds" parameterType="String">
delete from dc_road_condition_information where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>