<?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="cn.com.basic.security.entity.SeDuty">
|
<resultMap id="BaseResultMap" type="cn.com.basic.security.entity.SeDuty">
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="content" property="content" jdbcType="VARCHAR" />
|
<result column="starttime" property="starttime" jdbcType="VARCHAR" />
|
<result column="endtime" property="endtime" jdbcType="VARCHAR" />
|
<result column="color" property="color" jdbcType="VARCHAR" />
|
<result column="userid" property="userid" jdbcType="VARCHAR" />
|
<result column="is_valid" property="isValid" jdbcType="TINYINT" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
|
<result column="allday" property="allday" jdbcType="VARCHAR" />
|
<result column="personnelid" property="personnelid" jdbcType="VARCHAR" />
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
id, content, starttime, endtime, color, userid,is_valid , update_time ,
|
update_user_id,allday,personnelid
|
</sql>
|
|
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.String">
|
select
|
<include refid="Base_Column_List" />
|
from se_duty
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
|
<select id="selectAll" resultType="cn.com.basic.security.entity.SeDuty"
|
parameterType="cn.com.basic.security.entity.SeDuty">
|
select
|
d.id, d.content, d.starttime, d.endtime, d.color, d.userid, p.name username
|
from se_duty d
|
join se_personnel p on d.personnelid = p.id where d.is_valid = 1
|
order by starttime desc
|
</select>
|
|
<select id="select" resultType="cn.com.basic.security.entity.SeDuty"
|
parameterType="cn.com.basic.security.entity.SeDuty">
|
select
|
d.id, d.content, d.starttime, d.endtime, d.color, d.userid, p.name
|
username,d.allday
|
from se_duty d
|
join se_personnel p on d.personnelid = p.id where 1 = 1
|
<if test="isValid != null">
|
and d.is_valid = #{isValid,jdbcType=TINYINT}
|
</if>
|
order by starttime desc
|
</select>
|
|
<delete id="deleteById" parameterType="java.lang.String">
|
delete from se_duty
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
|
<insert id="insert" parameterType="cn.com.basic.security.entity.SeDuty">
|
insert into se_duty (id, content, starttime,
|
endtime, color, userid,is_valid,update_time,update_user_id,allday
|
,personnelid)
|
values (#{id,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
|
#{starttime,jdbcType=VARCHAR},
|
#{endtime,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR},#{isValid,jdbcType=TINYINT},#{updateTime,jdbcType=TIMESTAMP},
|
#{updateUserId,jdbcType=VARCHAR},#{allday,jdbcType=VARCHAR},#{personnelid,jdbcType=VARCHAR}
|
)
|
</insert>
|
|
<update id="updateByIdSelective" parameterType="cn.com.basic.security.entity.SeDuty">
|
update se_duty
|
<set>
|
<if test="content != null">
|
content = #{content,jdbcType=VARCHAR},
|
</if>
|
<if test="starttime != null">
|
starttime = #{starttime,jdbcType=VARCHAR},
|
</if>
|
<if test="endtime != null">
|
endtime = #{endtime,jdbcType=VARCHAR},
|
</if>
|
<if test="color != null">
|
color = #{color,jdbcType=VARCHAR},
|
</if>
|
<if test="userid != null">
|
userid = #{userid,jdbcType=VARCHAR},
|
</if>
|
<if test="allday != null">
|
allday = #{allday,jdbcType=VARCHAR},
|
</if>
|
<if test="isValid != null">
|
is_valid = #{isValid,jdbcType=TINYINT},
|
</if>
|
<if test="updateTime != null">
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUserId != null">
|
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
</if>
|
<if test="personnelid != null">
|
personnelid = #{personnelid,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<update id="updateById" parameterType="cn.com.basic.security.entity.SeDuty">
|
update se_duty
|
set content = #{content,jdbcType=VARCHAR},
|
starttime = #{starttime,jdbcType=VARCHAR},
|
endtime = #{endtime,jdbcType=VARCHAR},
|
color = #{color,jdbcType=VARCHAR},
|
userid = #{userid,jdbcType=VARCHAR},
|
personnelid = #{personnelid,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|