ganzi-api/inventory-dao/src/main/resources/mapper/SysLogAuthMapper.xml
2022-09-16 15:07:17 +08:00

339 lines
13 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.rzyc.mapper.SysLogAuthMapper">
<resultMap id="BaseResultMap" type="com.rzyc.model.SysLogAuth">
<id column="SysLogAuthId" jdbcType="VARCHAR" property="syslogauthid" />
<result column="AuthUserId" jdbcType="VARCHAR" property="authuserid" />
<result column="AuthUserName" jdbcType="VARCHAR" property="authusername" />
<result column="AuthOptType" jdbcType="VARCHAR" property="authopttype" />
<result column="AuthOptTime" jdbcType="TIMESTAMP" property="authopttime" />
<result column="AuthOptIP" jdbcType="VARCHAR" property="authoptip" />
<result column="AuthOptStatus" jdbcType="VARCHAR" property="authoptstatus" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="SysEnterpriseId" jdbcType="VARCHAR" property="sysenterpriseid" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
SysLogAuthId, AuthUserId, AuthUserName, AuthOptType, AuthOptTime, AuthOptIP, AuthOptStatus,
CreatedBy, CreatedOn, ModifiedBy, ModifiedOn, SysEnterpriseId
</sql>
<select id="selectByExample" parameterType="com.rzyc.model.SysLogAuthExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from SysLogAuth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from SysLogAuth
where SysLogAuthId = #{syslogauthid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SysLogAuth
where SysLogAuthId = #{syslogauthid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.rzyc.model.SysLogAuthExample">
delete from SysLogAuth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.rzyc.model.SysLogAuth">
insert into SysLogAuth (SysLogAuthId, AuthUserId, AuthUserName,
AuthOptType, AuthOptTime, AuthOptIP,
AuthOptStatus, CreatedBy, CreatedOn,
ModifiedBy, ModifiedOn, SysEnterpriseId
)
values (#{syslogauthid,jdbcType=VARCHAR}, #{authuserid,jdbcType=VARCHAR}, #{authusername,jdbcType=VARCHAR},
#{authopttype,jdbcType=VARCHAR}, #{authopttime,jdbcType=TIMESTAMP}, #{authoptip,jdbcType=VARCHAR},
#{authoptstatus,jdbcType=VARCHAR}, #{createdby,jdbcType=VARCHAR}, #{createdon,jdbcType=TIMESTAMP},
#{modifiedby,jdbcType=VARCHAR}, #{modifiedon,jdbcType=TIMESTAMP}, #{sysenterpriseid,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.rzyc.model.SysLogAuth">
insert into SysLogAuth
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="syslogauthid != null">
SysLogAuthId,
</if>
<if test="authuserid != null">
AuthUserId,
</if>
<if test="authusername != null">
AuthUserName,
</if>
<if test="authopttype != null">
AuthOptType,
</if>
<if test="authopttime != null">
AuthOptTime,
</if>
<if test="authoptip != null">
AuthOptIP,
</if>
<if test="authoptstatus != null">
AuthOptStatus,
</if>
<if test="createdby != null">
CreatedBy,
</if>
<if test="createdon != null">
CreatedOn,
</if>
<if test="modifiedby != null">
ModifiedBy,
</if>
<if test="modifiedon != null">
ModifiedOn,
</if>
<if test="sysenterpriseid != null">
SysEnterpriseId,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="syslogauthid != null">
#{syslogauthid,jdbcType=VARCHAR},
</if>
<if test="authuserid != null">
#{authuserid,jdbcType=VARCHAR},
</if>
<if test="authusername != null">
#{authusername,jdbcType=VARCHAR},
</if>
<if test="authopttype != null">
#{authopttype,jdbcType=VARCHAR},
</if>
<if test="authopttime != null">
#{authopttime,jdbcType=TIMESTAMP},
</if>
<if test="authoptip != null">
#{authoptip,jdbcType=VARCHAR},
</if>
<if test="authoptstatus != null">
#{authoptstatus,jdbcType=VARCHAR},
</if>
<if test="createdby != null">
#{createdby,jdbcType=VARCHAR},
</if>
<if test="createdon != null">
#{createdon,jdbcType=TIMESTAMP},
</if>
<if test="modifiedby != null">
#{modifiedby,jdbcType=VARCHAR},
</if>
<if test="modifiedon != null">
#{modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="sysenterpriseid != null">
#{sysenterpriseid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.rzyc.model.SysLogAuthExample" resultType="java.lang.Long">
select count(*) from SysLogAuth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update SysLogAuth
<set>
<if test="record.syslogauthid != null">
SysLogAuthId = #{record.syslogauthid,jdbcType=VARCHAR},
</if>
<if test="record.authuserid != null">
AuthUserId = #{record.authuserid,jdbcType=VARCHAR},
</if>
<if test="record.authusername != null">
AuthUserName = #{record.authusername,jdbcType=VARCHAR},
</if>
<if test="record.authopttype != null">
AuthOptType = #{record.authopttype,jdbcType=VARCHAR},
</if>
<if test="record.authopttime != null">
AuthOptTime = #{record.authopttime,jdbcType=TIMESTAMP},
</if>
<if test="record.authoptip != null">
AuthOptIP = #{record.authoptip,jdbcType=VARCHAR},
</if>
<if test="record.authoptstatus != null">
AuthOptStatus = #{record.authoptstatus,jdbcType=VARCHAR},
</if>
<if test="record.createdby != null">
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
</if>
<if test="record.createdon != null">
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
</if>
<if test="record.modifiedby != null">
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
</if>
<if test="record.modifiedon != null">
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="record.sysenterpriseid != null">
SysEnterpriseId = #{record.sysenterpriseid,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update SysLogAuth
set SysLogAuthId = #{record.syslogauthid,jdbcType=VARCHAR},
AuthUserId = #{record.authuserid,jdbcType=VARCHAR},
AuthUserName = #{record.authusername,jdbcType=VARCHAR},
AuthOptType = #{record.authopttype,jdbcType=VARCHAR},
AuthOptTime = #{record.authopttime,jdbcType=TIMESTAMP},
AuthOptIP = #{record.authoptip,jdbcType=VARCHAR},
AuthOptStatus = #{record.authoptstatus,jdbcType=VARCHAR},
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
SysEnterpriseId = #{record.sysenterpriseid,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.rzyc.model.SysLogAuth">
update SysLogAuth
<set>
<if test="authuserid != null">
AuthUserId = #{authuserid,jdbcType=VARCHAR},
</if>
<if test="authusername != null">
AuthUserName = #{authusername,jdbcType=VARCHAR},
</if>
<if test="authopttype != null">
AuthOptType = #{authopttype,jdbcType=VARCHAR},
</if>
<if test="authopttime != null">
AuthOptTime = #{authopttime,jdbcType=TIMESTAMP},
</if>
<if test="authoptip != null">
AuthOptIP = #{authoptip,jdbcType=VARCHAR},
</if>
<if test="authoptstatus != null">
AuthOptStatus = #{authoptstatus,jdbcType=VARCHAR},
</if>
<if test="createdby != null">
CreatedBy = #{createdby,jdbcType=VARCHAR},
</if>
<if test="createdon != null">
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
</if>
<if test="modifiedby != null">
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
</if>
<if test="modifiedon != null">
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="sysenterpriseid != null">
SysEnterpriseId = #{sysenterpriseid,jdbcType=VARCHAR},
</if>
</set>
where SysLogAuthId = #{syslogauthid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.rzyc.model.SysLogAuth">
update SysLogAuth
set AuthUserId = #{authuserid,jdbcType=VARCHAR},
AuthUserName = #{authusername,jdbcType=VARCHAR},
AuthOptType = #{authopttype,jdbcType=VARCHAR},
AuthOptTime = #{authopttime,jdbcType=TIMESTAMP},
AuthOptIP = #{authoptip,jdbcType=VARCHAR},
AuthOptStatus = #{authoptstatus,jdbcType=VARCHAR},
CreatedBy = #{createdby,jdbcType=VARCHAR},
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
SysEnterpriseId = #{sysenterpriseid,jdbcType=VARCHAR}
where SysLogAuthId = #{syslogauthid,jdbcType=VARCHAR}
</update>
<!--认证日志-->
<select id="findAll" resultMap="BaseResultMap">
SELECT * FROM `SysLogAuth` sl
WHERE sl.`AuthUserName` LIKE #{condition}
ORDER BY sl.`CreatedOn` DESC
</select>
</mapper>