<?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.Se_Reward_Punishment_Info" >
|
<resultMap id="BaseResultMap" type="cn.com.basic.security.entity.Se_Reward_Punishment_Info" >
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="personnel_id" property="personnelId" jdbcType="VARCHAR" />
|
<result column="type" property="type" jdbcType="TINYINT" />
|
<result column="amount" property="amount" jdbcType="DECIMAL" />
|
<result column="remarks" property="remarks" jdbcType="VARCHAR" />
|
<result column="status" property="status" jdbcType="TINYINT" />
|
<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" />
|
</resultMap>
|
|
<sql id="Base_Column_List" >
|
id, personnel_id, type, amount, remarks, status, is_valid,
|
update_time, update_user_id
|
</sql>
|
|
<!-- 查询总数 -->
|
<select id="selectCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
SELECT count(id) FROM se_reward_punishment_info where is_valid = 1
|
</select>
|
|
<select id="selectById"
|
resultType="cn.com.basic.security.entity.Se_Reward_Punishment_Info"
|
parameterType="java.util.Map" >
|
SELECT
|
r.id,p.id personnelId,p.`name` personnelName,o.`name` orgName,p.post ,p.id_number idNumber , r.type,r.update_time updateTime,r.amount,r.remarks
|
FROM se_reward_punishment_info r
|
JOIN se_personnel p ON p.id = r.personnel_id
|
JOIN t_sys_organization o ON o.id = p.org_id
|
WHERE r.id = #{id,jdbcType=VARCHAR}
|
</select>
|
|
<select id="select"
|
resultType="cn.com.basic.security.entity.Se_Reward_Punishment_Info"
|
parameterType="java.util.Map" >
|
SELECT
|
r.id,p.id personnelId,p.`name` personnelName,o.`name` orgName,p.post ,p.id_number idNumber , r.type,r.update_time updateTime,r.amount,r.remarks
|
FROM se_reward_punishment_info r
|
JOIN se_personnel p ON p.id = r.personnel_id
|
JOIN t_sys_organization o ON o.id = p.org_id
|
where r.is_valid = 1
|
ORDER BY r.update_time desc
|
LIMIT #{offset}, #{limit}
|
</select>
|
|
<delete id="deleteById" parameterType="java.lang.String" >
|
delete from se_reward_punishment_info
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
|
<insert id="insert" parameterType="cn.com.basic.security.entity.Se_Reward_Punishment_Info" >
|
insert into se_reward_punishment_info (id, personnel_id, type,
|
amount, remarks, status,
|
is_valid, update_time, update_user_id
|
)
|
values (#{id,jdbcType=VARCHAR}, #{personnelId,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
|
#{amount,jdbcType=DECIMAL}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
|
#{isValid,jdbcType=TINYINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=VARCHAR}
|
)
|
</insert>
|
|
<insert id="insertSelective" parameterType="cn.com.basic.security.entity.Se_Reward_Punishment_Info" >
|
insert into se_reward_punishment_info
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="personnelId != null" >
|
personnel_id,
|
</if>
|
<if test="type != null" >
|
type,
|
</if>
|
<if test="amount != null" >
|
amount,
|
</if>
|
<if test="remarks != null" >
|
remarks,
|
</if>
|
<if test="status != null" >
|
status,
|
</if>
|
<if test="isValid != null" >
|
is_valid,
|
</if>
|
<if test="updateTime != null" >
|
update_time,
|
</if>
|
<if test="updateUserId != null" >
|
update_user_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="personnelId != null" >
|
#{personnelId,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
#{type,jdbcType=TINYINT},
|
</if>
|
<if test="amount != null" >
|
#{amount,jdbcType=DECIMAL},
|
</if>
|
<if test="remarks != null" >
|
#{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
#{status,jdbcType=TINYINT},
|
</if>
|
<if test="isValid != null" >
|
#{isValid,jdbcType=TINYINT},
|
</if>
|
<if test="updateTime != null" >
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUserId != null" >
|
#{updateUserId,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="cn.com.basic.security.entity.Se_Reward_Punishment_Info" >
|
update se_reward_punishment_info
|
<set >
|
<if test="personnelId != null" >
|
personnel_id = #{personnelId,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
type = #{type,jdbcType=TINYINT},
|
</if>
|
<if test="amount != null" >
|
amount = #{amount,jdbcType=DECIMAL},
|
</if>
|
<if test="remarks != null" >
|
remarks = #{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
status = #{status,jdbcType=TINYINT},
|
</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>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<update id="updateById" parameterType="cn.com.basic.security.entity.Se_Reward_Punishment_Info" >
|
update se_reward_punishment_info
|
set personnel_id = #{personnelId,jdbcType=VARCHAR},
|
type = #{type,jdbcType=TINYINT},
|
amount = #{amount,jdbcType=DECIMAL},
|
remarks = #{remarks,jdbcType=VARCHAR},
|
status = #{status,jdbcType=TINYINT},
|
is_valid = #{isValid,jdbcType=TINYINT},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
update_user_id = #{updateUserId,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<update id="updateValidById" parameterType="cn.com.basic.security.entity.Se_Reward_Punishment_Info" >
|
update se_reward_punishment_info set is_valid = #{isValid,jdbcType=TINYINT} where id = #{id,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|