98 lines
5.1 KiB
XML
98 lines
5.1 KiB
XML
<?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.evo.attendance.mapper.RzAbnormalDetailMapper">
|
|
|
|
<resultMap type="RzAbnormalDetail" id="RzAbnormalDetailResult">
|
|
<result property="id" column="id" />
|
|
<result property="abnormalId" column="abnormal_id" />
|
|
<result property="name" column="name" />
|
|
<result property="clockDate" column="clock_date" />
|
|
<result property="clockType" column="clock_type" />
|
|
<result property="abnormalTime" column="abnormal_time" />
|
|
<result property="money" column="money" />
|
|
<result property="remarks" column="remarks" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
</resultMap>
|
|
|
|
<sql id="selectRzAbnormalDetailVo">
|
|
select id, abnormal_id, name,clock_date,clock_type, abnormal_time, money, remarks, del_flag, create_by, create_time, update_time, update_by from rz_abnormal_detail
|
|
</sql>
|
|
|
|
<select id="selectRzAbnormalDetailList" parameterType="RzAbnormalDetail" resultMap="RzAbnormalDetailResult">
|
|
<include refid="selectRzAbnormalDetailVo"/>
|
|
<where>
|
|
del_flag = '0'
|
|
<if test="abnormalId != null "> and abnormal_id = #{abnormalId}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
<if test="clockDate != null "> and date_format(clock_date,'%y%m%d') = date_format(#{clockDate},'%y%m%d') </if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectRzAbnormalDetailById" parameterType="Long" resultMap="RzAbnormalDetailResult">
|
|
<include refid="selectRzAbnormalDetailVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertRzAbnormalDetail" parameterType="RzAbnormalDetail" useGeneratedKeys="true" keyProperty="id">
|
|
insert into rz_abnormal_detail
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="abnormalId != null">abnormal_id,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="clockDate != null">clock_date,</if>
|
|
<if test="clockType != null clockType != ''">clock_type,</if>
|
|
<if test="abnormalTime != null">abnormal_time,</if>
|
|
<if test="money != null">money,</if>
|
|
<if test="remarks != null">remarks,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="abnormalId != null">#{abnormalId},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="clockDate != null">#{clockDate},</if>
|
|
<if test="clockType != null and clockType != ''">#{clockType},</if>
|
|
<if test="abnormalTime != null">#{abnormalTime},</if>
|
|
<if test="money != null">#{money},</if>
|
|
<if test="remarks != null">#{remarks},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateRzAbnormalDetail" parameterType="RzAbnormalDetail">
|
|
update rz_abnormal_detail
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="abnormalId != null">abnormal_id = #{abnormalId},</if>
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="clockDate != null">clock_date = #{clockDate},</if>
|
|
<if test="abnormalTime != null">abnormal_time = #{abnormalTime},</if>
|
|
<if test="money != null">money = #{money},</if>
|
|
<if test="remarks != null">remarks = #{remarks},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
<!-- 根据异常ID查询数据 -->
|
|
<select id="selectRzAbnormalDetailByAbnormalId" parameterType="Long" resultMap="RzAbnormalDetailResult">
|
|
<include refid="selectRzAbnormalDetailVo"/>
|
|
where abnormal_id = #{abnormalId} and del_flag = '0'
|
|
</select>
|
|
|
|
</mapper>
|