<?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.cloud.attendance.dao.AttRuleDao">
|
<resultMap id="BaseResultMap" type="com.cloud.attendance.model.AttRule">
|
<id column="id" jdbcType="INTEGER" property="id" />
|
<result column="enable" jdbcType="INTEGER" property="enable" />
|
<result column="recordBegin" jdbcType="VARCHAR" property="recordBegin" />
|
<result column="recordEnd" jdbcType="VARCHAR" property="recordEnd" />
|
<result column="inTime" jdbcType="VARCHAR" property="inTime" />
|
<result column="inTimeMin" jdbcType="INTEGER" property="inTimeMin" />
|
<result column="outTime" jdbcType="VARCHAR" property="outTime" />
|
<result column="outTimeMin" jdbcType="INTEGER" property="outTimeMin" />
|
<result column="revJson" jdbcType="CHAR" property="revJson" />
|
<result column="isNoticeApp" jdbcType="INTEGER" property="isNoticeApp" />
|
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
<result column="delFlag" jdbcType="VARCHAR" property="delFlag" />
|
<result column="deviceIds" jdbcType="VARCHAR" property="deviceIds" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, enable, recordBegin, recordEnd, inTime, inTimeMin, outTime, outTimeMin, revJson,
|
isNoticeApp, createBy, createTime, updateBy, updateTime, remarks, delFlag,deviceIds
|
</sql>
|
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from att_rule
|
where id = #{id,jdbcType=INTEGER}
|
</select>
|
|
<select id="selectAttRule" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List" ></include>
|
from att_rule
|
where delFlag = 0
|
ORDER BY updateTime DESC,createTime DESC LIMIT 1
|
</select>
|
|
<delete id="deleteById" parameterType="java.lang.Integer">
|
delete from att_rule
|
where id = #{id,jdbcType=INTEGER}
|
</delete>
|
<insert id="save" parameterType="com.cloud.attendance.model.AttRule">
|
insert into att_rule (enable, recordBegin, recordEnd,
|
inTime, inTimeMin, outTime,
|
outTimeMin, revJson, isNoticeApp,
|
createBy, createTime, updateBy,
|
updateTime, remarks, delFlag,deviceIds
|
)
|
values (#{enable,jdbcType=INTEGER}, #{recordBegin,jdbcType=VARCHAR}, #{recordEnd,jdbcType=VARCHAR},
|
#{inTime,jdbcType=VARCHAR}, #{inTimeMin,jdbcType=INTEGER}, #{outTime,jdbcType=VARCHAR},
|
#{outTimeMin,jdbcType=INTEGER}, #{revJson,jdbcType=CHAR}, #{isNoticeApp,jdbcType=INTEGER},
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
#{updateTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR}, #{deviceIds,jdbcType=VARCHAR}
|
)
|
</insert>
|
<insert id="saveSelective" parameterType="com.cloud.attendance.model.AttRule">
|
insert into att_rule
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="enable != null">
|
enable,
|
</if>
|
<if test="recordBegin != null">
|
recordBegin,
|
</if>
|
<if test="recordEnd != null">
|
recordEnd,
|
</if>
|
<if test="inTime != null">
|
inTime,
|
</if>
|
<if test="inTimeMin != null">
|
inTimeMin,
|
</if>
|
<if test="outTime != null">
|
outTime,
|
</if>
|
<if test="outTimeMin != null">
|
outTimeMin,
|
</if>
|
<if test="revJson != null">
|
revJson,
|
</if>
|
<if test="isNoticeApp != null">
|
isNoticeApp,
|
</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>
|
<if test="remarks != null">
|
remarks,
|
</if>
|
<if test="delFlag != null">
|
delFlag,
|
</if>
|
<if test="deviceIds != null">
|
deviceIds,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="enable != null">
|
#{enable,jdbcType=INTEGER},
|
</if>
|
<if test="recordBegin != null">
|
#{recordBegin,jdbcType=VARCHAR},
|
</if>
|
<if test="recordEnd != null">
|
#{recordEnd,jdbcType=VARCHAR},
|
</if>
|
<if test="inTime != null">
|
#{inTime,jdbcType=VARCHAR},
|
</if>
|
<if test="inTimeMin != null">
|
#{inTimeMin,jdbcType=INTEGER},
|
</if>
|
<if test="outTime != null">
|
#{outTime,jdbcType=VARCHAR},
|
</if>
|
<if test="outTimeMin != null">
|
#{outTimeMin,jdbcType=INTEGER},
|
</if>
|
<if test="revJson != null">
|
#{revJson,jdbcType=CHAR},
|
</if>
|
<if test="isNoticeApp != null">
|
#{isNoticeApp,jdbcType=INTEGER},
|
</if>
|
<if test="createBy != null">
|
#{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null">
|
#{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null">
|
#{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
#{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="deviceIds != null">
|
#{deviceIds,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByIdSelective" parameterType="com.cloud.attendance.model.AttRule">
|
update att_rule
|
<set>
|
<if test="enable != null">
|
enable = #{enable,jdbcType=INTEGER},
|
</if>
|
<if test="recordBegin != null">
|
recordBegin = #{recordBegin,jdbcType=VARCHAR},
|
</if>
|
<if test="recordEnd != null">
|
recordEnd = #{recordEnd,jdbcType=VARCHAR},
|
</if>
|
<if test="inTime != null">
|
inTime = #{inTime,jdbcType=VARCHAR},
|
</if>
|
<if test="inTimeMin != null">
|
inTimeMin = #{inTimeMin,jdbcType=INTEGER},
|
</if>
|
<if test="outTime != null">
|
outTime = #{outTime,jdbcType=VARCHAR},
|
</if>
|
<if test="outTimeMin != null">
|
outTimeMin = #{outTimeMin,jdbcType=INTEGER},
|
</if>
|
<if test="revJson != null">
|
revJson = #{revJson,jdbcType=CHAR},
|
</if>
|
<if test="isNoticeApp != null">
|
isNoticeApp = #{isNoticeApp,jdbcType=INTEGER},
|
</if>
|
<if test="createBy != null">
|
createBy = #{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null">
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null">
|
remarks = #{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null">
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="deviceIds != null">
|
deviceIds = #{deviceIds,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
<update id="updateById" parameterType="com.cloud.attendance.model.AttRule">
|
update att_rule
|
set enable = #{enable,jdbcType=INTEGER},
|
recordBegin = #{recordBegin,jdbcType=VARCHAR},
|
recordEnd = #{recordEnd,jdbcType=VARCHAR},
|
inTime = #{inTime,jdbcType=VARCHAR},
|
inTimeMin = #{inTimeMin,jdbcType=INTEGER},
|
outTime = #{outTime,jdbcType=VARCHAR},
|
outTimeMin = #{outTimeMin,jdbcType=INTEGER},
|
revJson = #{revJson,jdbcType=CHAR},
|
isNoticeApp = #{isNoticeApp,jdbcType=INTEGER},
|
createBy = #{createBy,jdbcType=VARCHAR},
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
remarks = #{remarks,jdbcType=VARCHAR},
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
deviceIds = #{deviceIds,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
</mapper>
|