|
|
|
|
<?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="net.lab1024.sa.admin.module.penalty.dao.PenaltyApplyDao">
|
|
|
|
|
|
|
|
|
|
<!-- 查询结果列 -->
|
|
|
|
|
<sql id="base_columns">
|
|
|
|
|
t_penalty_apply.id,
|
|
|
|
|
t_penalty_apply.user_id,
|
|
|
|
|
t_penalty_apply.apply_date,
|
|
|
|
|
t_penalty_apply.use_purpose,
|
|
|
|
|
t_penalty_apply.status,
|
|
|
|
|
t_penalty_apply.create_time,
|
|
|
|
|
t_penalty_apply.update_time,
|
|
|
|
|
t_penalty_apply.deleted_flag
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
|
|
<select id="queryPage" resultType="net.lab1024.sa.admin.module.penalty.domain.vo.PenaltyApplyVO">
|
|
|
|
|
SELECT
|
|
|
|
|
tp_apply.id,
|
|
|
|
|
tp_apply.user_id as userId,
|
|
|
|
|
tp_apply.apply_date as applyDate,
|
|
|
|
|
tp_apply.use_purpose as usePurpose,
|
|
|
|
|
tp_apply.status as status,
|
|
|
|
|
tp_apply.create_time as createTime,
|
|
|
|
|
tp_apply.update_time as updateTime,
|
|
|
|
|
tp_apply.deleted_flag as deletedFlag,
|
|
|
|
|
te_employee.actual_name AS userName
|
|
|
|
|
FROM t_penalty_apply tp_apply left join t_employee te_employee on tp_apply.user_id = te_employee.employee_id
|
|
|
|
|
<where>
|
|
|
|
|
tp_apply.deleted_flag = 0
|
|
|
|
|
<if test="queryForm != null">
|
|
|
|
|
<if test="queryForm.userName != null and queryForm.userName != ''">
|
|
|
|
|
AND te_employee.actual_name like concat('%',#{queryForm.userName},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="queryForm.status != null and queryForm.status != ''">
|
|
|
|
|
AND tp_apply.status = #{queryForm.status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="queryForm.applyDateStart != null">
|
|
|
|
|
AND tp_apply.apply_date >= #{queryForm.applyDateStart}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="queryForm.applyDateEnd != null">
|
|
|
|
|
AND tp_apply.apply_date <= #{queryForm.applyDateEnd}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="queryForm.userId != null">
|
|
|
|
|
AND tp_apply.user_id = #{queryForm.userId}
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="batchUpdateDeleted">
|
|
|
|
|
update t_penalty_apply set deleted_flag = #{deletedFlag}
|
|
|
|
|
where id in
|
|
|
|
|
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateDeleted">
|
|
|
|
|
update t_penalty_apply set deleted_flag = #{deletedFlag}
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
</mapper>
|