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

186 lines
11 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.DcPublishManageMapper">
<resultMap type="DcPublishManage" id="DcPublishManageResult">
<result property="id" column="id" />
<result property="eventId" column="event_id" />
<result property="deptId" column="dept_id" />
<result property="publishChannelsId" column="publish_channels_id" />
<result property="title" column="title" />
<result property="publishChannels" column="publish_channels" />
<result property="isverify" column="isverify" />
<result property="publisher" column="publisher" />
<result property="auditor1" column="auditor_1" />
<result property="auditor2" column="auditor_2" />
<result property="auditTime1" column="audit_time_1" />
<result property="auditTime2" column="audit_time_2" />
<result property="auditComment1" column="audit_comment_1" />
<result property="auditComment2" column="audit_comment_2" />
<result property="publishTime" column="publish_time" />
<result property="publishStatus" column="publish_status" />
<result property="contentDetails" column="content_details" />
<result property="remark" column="remark" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="direction" column="direction" />
<result property="stakeMark" column="stake_mark" />
<result property="eventType" column="event_type" />
<result property="eventSubclass" column="event_subclass" />
<result property="eventTime" column="eventTime" />
<result property="facilityName" column="facility_name" />
<result property="eventState" column="event_state" />
</resultMap>
<sql id="selectDcPublishManageVo">
select
manage.id, manage.event_id, manage.publish_channels_id,
manage.title , manage.create_time,
manage.publish_status,event.create_time eventTime,event.direction,event.stake_mark,
event.event_type,event.event_subclass,event.event_state
from dc_publish_manage as manage
LEFT JOIN dc_event as event on event.id=manage.event_id
LEFT JOIN dc_event_traffic_control as traffic on event.id=traffic.id
LEFT JOIN dc_facility as facility ON traffic.facility_id=facility.id
</sql>
<select id="selectEventDcPublishManageList" resultType="com.zc.business.domain.DcPublishManage">
select facility.facility_name,event.event_state,manage.publish_time, manage.create_time,
manage.id, manage.event_id, manage.publish_channels_id,
manage.title, manage.publish_channels , manage.publisher,
manage.publish_status, manage.content_details, manage.remark,
event.create_time eventTime
from dc_publish_manage as manage
LEFT JOIN dc_event as event on event.id=manage.event_id
LEFT JOIN dc_event_traffic_control as traffic on event.id=traffic.id
LEFT JOIN dc_facility as facility ON traffic.facility_id=facility.id
where manage.event_id=#{eventId}
</select>
<select id="selectDcPublishManageList" parameterType="DcPublishManage" resultMap="DcPublishManageResult">
<include refid="selectDcPublishManageVo"/>
<where>
<if test="eventState != null"> and event.event_state = #{eventState}</if>
<if test="eventType != null and eventType != ''"> and event.event_type = #{eventType}</if>
<if test="publishStatus != null and publishStatus != '' "> and manage.publish_status = #{publishStatus}</if>
<if test="startTime != null and endTime != null ">
and manage.create_time between #{startTime} and #{endTime}
</if>
<if test="startStakeMark != null and startStakeMark != ''">
and CAST(SUBSTRING(SUBSTRING_INDEX(event.stake_mark,'+',1),2)AS UNSIGNED)*1000
+CAST(SUBSTRING_INDEX(event.stake_mark, '+', -1) AS UNSIGNED)&gt;=#{startStakeMark}
</if>
<if test=" endStakeMark != null and endStakeMark != '' ">
and CAST(SUBSTRING(SUBSTRING_INDEX(event.stake_mark,'+',1),2)AS UNSIGNED)*1000
+CAST(SUBSTRING_INDEX(event.stake_mark, '+', -1) AS UNSIGNED)&lt;=#{endStakeMark}
</if>
</where>
GROUP BY manage.event_id
12 months ago
ORDER BY event.create_time desc
</select>
<select id="selectDcPublishManageById" parameterType="Long" resultMap="DcPublishManageResult">
<include refid="selectDcPublishManageVo"/>
where id = #{id}
</select>
<select id="selectEventType" resultType="java.lang.Integer">
select event_type from dc_event where id=#{eventId}
</select>
<select id="selectPublishManage" resultType="com.zc.business.domain.DcPublishManage">
select id,publish_channels from dc_publishing_channels where enabled=2 and data_category=#{dataCategory}
</select>
<select id="selectDcPublishManageListMap" resultType="java.util.HashMap">
select
event.occurrence_time,event.direction,event.event_type,event.stake_mark,
manage.id, manage.event_id, manage.publish_channels_id,
manage.title, manage.publish_channels, manage.publisher,
manage.publish_time, manage.publish_status, manage.content_details, manage.remark,
manage.update_time, manage.create_time from dc_publish_manage as manage
LEFT JOIN dc_event as event on manage.event_id=event.id
</select>
<insert id="insertDcPublishManage" parameterType="DcPublishManage" useGeneratedKeys="true" keyProperty="id">
insert into dc_publish_manage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventId != null and eventId != ''">event_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="publishChannelsId != null">publish_channels_id,</if>
<if test="title != null">title,</if>
<if test="publishChannels != null">publish_channels,</if>
<if test="isverify != null">isverify,</if>
<if test="publisher != null and publisher != ''">publisher,</if>
<if test="auditor1 != null">auditor_1,</if>
<if test="auditor2 != null">auditor_2,</if>
<if test="auditTime1 != null">audit_time_1,</if>
<if test="auditTime2 != null">audit_time_2,</if>
<if test="auditComment1 != null">audit_comment_1,</if>
<if test="auditComment2 != null">audit_comment_2,</if>
<if test="publishTime != null">publish_time,</if>
<if test="publishStatus != null">publish_status,</if>
<if test="contentDetails != null">content_details,</if>
<if test="remark != null">remark,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventId != null and eventId != ''">#{eventId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="publishChannelsId != null">#{publishChannelsId},</if>
<if test="title != null">#{title},</if>
<if test="publishChannels != null">#{publishChannels},</if>
<if test="isverify != null">#{isverify},</if>
<if test="publisher != null and publisher != ''">#{publisher},</if>
<if test="auditor1 != null">#{auditor1},</if>
<if test="auditor2 != null">#{auditor2},</if>
<if test="auditTime1 != null">#{auditTime1},</if>
<if test="auditTime2 != null">#{auditTime2},</if>
<if test="auditComment1 != null">#{auditComment1},</if>
<if test="auditComment2 != null">#{auditComment2},</if>
<if test="publishTime != null">#{publishTime},</if>
<if test="publishStatus != null">#{publishStatus},</if>
<if test="contentDetails != null">#{contentDetails},</if>
<if test="remark != null">#{remark},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateDcPublishManage" parameterType="DcPublishManage">
update dc_publish_manage
<trim prefix="SET" suffixOverrides=",">
<if test="eventId != null and eventId != ''">event_id = #{eventId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="publishChannelsId != null">publish_channels_id = #{publishChannelsId},</if>
<if test="title != null">title = #{title},</if>
<if test="publishChannels != null">publish_channels = #{publishChannels},</if>
<if test="isverify != null">isverify = #{isverify},</if>
<if test="publisher != null and publisher != ''">publisher = #{publisher},</if>
<if test="auditor1 != null">auditor_1 = #{auditor1},</if>
<if test="auditor2 != null">auditor_2 = #{auditor2},</if>
<if test="auditTime1 != null">audit_time_1 = #{auditTime1},</if>
<if test="auditTime2 != null">audit_time_2 = #{auditTime2},</if>
<if test="auditComment1 != null">audit_comment_1 = #{auditComment1},</if>
<if test="auditComment2 != null">audit_comment_2 = #{auditComment2},</if>
<if test="publishTime != null">publish_time = #{publishTime},</if>
<if test="publishStatus != null">publish_status = #{publishStatus},</if>
<if test="contentDetails != null">content_details = #{contentDetails},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcPublishManageById" parameterType="Long">
delete from dc_publish_manage where id = #{id}
</delete>
<delete id="deleteDcPublishManageByIds" parameterType="String">
delete from dc_publish_manage where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>