<?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.aps.core.mapper.ApsWorkEventMapper">
|
|
<resultMap type="com.aps.core.domain.ApsWorkEvent" id="ApsWorkEventResult">
|
<result property="id" column="id" />
|
<result property="description" column="description" />
|
<result property="duration" column="duration" />
|
<result property="startDate" column="start_date" />
|
<result property="endDate" column="end_date" />
|
<result property="startTime" column="start_time" />
|
<result property="endTime" column="end_time" />
|
<result property="applicableFactory" column="applicable_factory" />
|
<result property="applicableWorkshop" column="applicable_workshop" />
|
<result property="applicableProcess" column="applicable_process" />
|
<result property="applicableCalendar" column="applicable_calendar" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
</resultMap>
|
|
<sql id="selectApsWorkEventVo">
|
select id, description, duration, start_date, end_date, start_time, end_time, applicable_factory, applicable_workshop, applicable_process, applicable_calendar, create_by, create_time, update_by, update_time from aps_work_event
|
</sql>
|
|
<select id="selectApsWorkEventList" parameterType="com.aps.core.domain.ApsWorkEvent" resultMap="ApsWorkEventResult">
|
<include refid="selectApsWorkEventVo"/>
|
<where>
|
<if test="description != null and description != ''"> and description like '%' || #{description} || '%'</if>
|
<if test="duration != null and duration != ''"> and duration = #{duration}</if>
|
<if test="startDate != null "> and start_date = #{startDate}</if>
|
<if test="endDate != null "> and end_date = #{endDate}</if>
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
<if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if>
|
<if test="applicableFactory != null and applicableFactory != ''"> and applicable_factory = #{applicableFactory}</if>
|
<if test="applicableWorkshop != null and applicableWorkshop != ''"> and applicable_workshop = #{applicableWorkshop}</if>
|
<if test="applicableProcess != null and applicableProcess != ''"> and applicable_process = #{applicableProcess}</if>
|
<if test="applicableCalendar != null and applicableCalendar != ''"> and applicable_calendar = #{applicableCalendar}</if>
|
</where>
|
</select>
|
|
<select id="selectApsWorkEventById" parameterType="Long" resultMap="ApsWorkEventResult">
|
<include refid="selectApsWorkEventVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertApsWorkEvent" parameterType="com.aps.core.domain.ApsWorkEvent">
|
insert into aps_work_event
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="description != null and description != ''">description,</if>
|
<if test="duration != null and duration != ''">duration,</if>
|
<if test="startDate != null">start_date,</if>
|
<if test="endDate != null">end_date,</if>
|
<if test="startTime != null and startTime != ''">start_time,</if>
|
<if test="endTime != null and endTime != ''">end_time,</if>
|
<if test="applicableFactory != null and applicableFactory != ''">applicable_factory,</if>
|
<if test="applicableWorkshop != null and applicableWorkshop != ''">applicable_workshop,</if>
|
<if test="applicableProcess != null and applicableProcess != ''">applicable_process,</if>
|
<if test="applicableCalendar != null and applicableCalendar != ''">applicable_calendar,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="description != null and description != ''">#{description},</if>
|
<if test="duration != null and duration != ''">#{duration},</if>
|
<if test="startDate != null">#{startDate},</if>
|
<if test="endDate != null">#{endDate},</if>
|
<if test="startTime != null and startTime != ''">#{startTime},</if>
|
<if test="endTime != null and endTime != ''">#{endTime},</if>
|
<if test="applicableFactory != null and applicableFactory != ''">#{applicableFactory},</if>
|
<if test="applicableWorkshop != null and applicableWorkshop != ''">#{applicableWorkshop},</if>
|
<if test="applicableProcess != null and applicableProcess != ''">#{applicableProcess},</if>
|
<if test="applicableCalendar != null and applicableCalendar != ''">#{applicableCalendar},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateApsWorkEvent" parameterType="com.aps.core.domain.ApsWorkEvent">
|
update aps_work_event
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="description != null and description != ''">description = #{description},</if>
|
<if test="duration != null and duration != ''">duration = #{duration},</if>
|
<if test="startDate != null">start_date = #{startDate},</if>
|
<if test="endDate != null">end_date = #{endDate},</if>
|
<if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
|
<if test="endTime != null and endTime != ''">end_time = #{endTime},</if>
|
<if test="applicableFactory != null and applicableFactory != ''">applicable_factory = #{applicableFactory},</if>
|
<if test="applicableWorkshop != null and applicableWorkshop != ''">applicable_workshop = #{applicableWorkshop},</if>
|
<if test="applicableProcess != null and applicableProcess != ''">applicable_process = #{applicableProcess},</if>
|
<if test="applicableCalendar != null and applicableCalendar != ''">applicable_calendar = #{applicableCalendar},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteApsWorkEventById" parameterType="Long">
|
delete from aps_work_event where id = #{id}
|
</delete>
|
|
<delete id="deleteApsWorkEventByIds" parameterType="String">
|
delete from aps_work_event where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|