<?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.ruoyi.personnel.mapper.PersonRewardPunishmentRecordMapper">
|
|
|
<select id="rewardPunishmentPage" resultType="com.ruoyi.personnel.vo.PersonRewardPunishmentRecordVO">
|
select
|
cprpr.*,
|
us.name create_user_name,
|
u.account account,
|
u.name user_name,
|
us2.name AS update_user_name
|
from cnas_person_reward_punishment_record cprpr
|
left join user u on cprpr.user_id = u.id
|
left join user us on cprpr.create_user = us.id
|
left join user us2 on cprpr.update_user = us2.id
|
<where>
|
<if test="dto.userName != null and dto.userName != ''">
|
and u.name like concat('%', #{dto.userName}, '%')
|
</if>
|
<if test="dto.startTime != null and dto.startTime != null">
|
AND cprpr.reward_punish_time BETWEEN #{dto.startTime} AND #{dto.endTime}
|
</if>
|
</where>
|
</select>
|
|
<select id="rewardPunishmentExport" resultType="com.ruoyi.personnel.excel.PersonRewardPunishmentRecordExcel">
|
select cprpr.*, us.name create_user_name, u.account account, u.name user_name
|
from cnas_person_reward_punishment_record cprpr
|
left join user u on cprpr.user_id = u.id
|
left join user us on cprpr.create_user = us.id
|
<where>
|
<if test="dto.userName != null and dto.userName != ''">
|
and u.name like concat('%', #{dto.userName}, '%')
|
</if>
|
<if test="dto.startTime != null and dto.endTime != null">
|
AND cprpr.reward_punish_time BETWEEN #{dto.startTime} AND #{dto.endTime}
|
</if>
|
</where>
|
</select>
|
</mapper>
|