JNBusinessTest/ruoyi-system/target/classes/mapper/system/SysChangeRecordMapper.xml

36 lines
1.9 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.ruoyi.system.mapper.SysChangeRecordMapper">
<insert id="insertChangeRecord" parameterType="SysChangeRecord">
insert into sys_change_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="changeTime != null">changeTime,</if>
<if test="createName != null and createName != ''">createName,</if>
<if test="changeField != null and changeField != ''">changeField,</if>
<if test="beforeChange != null and beforeChange != ''">beforeChange,</if>
<if test="afterChange != null and afterChange != ''">afterChange,</if>
<if test="typeId != null and typeId != ''">typeId,</if>
<if test="codeName != null and codeName != ''">codeName,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="changeTime != null">#{changeTime},</if>
<if test="createName != null and createName != ''">#{createName},</if>
<if test="changeField != null and changeField != ''">#{changeField},</if>
<if test="beforeChange != null and beforeChange != ''">#{beforeChange},</if>
<if test="afterChange != null and afterChange != ''">#{afterChange},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="codeName != null and codeName != ''">#{codeName},</if>
</trim>
</insert>
<select id="recordsList" resultType="SysChangeRecord" parameterType="SysChangeRecord">
select a.changeTime,b.nick_name createName,a.changeField,
a.beforeChange,a.afterChange,a.typeId,a.codeName
from sys_change_record a
left join sys_user b on a.createName = b.user_name
where a.typeId = #{typeId}
</select>
</mapper>