alive-admin/alive-server/target/classes/mapper/system/UserPasswordMapper.xml

99 lines
4.7 KiB
XML
Raw Normal View History

2024-05-27 16:26:14 +08:00
<?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.UserPasswordMapper">
<resultMap type="com.ruoyi.system.domain.UserPassword" id="UserPasswordResult">
<result property="id" column="id" />
<result property="userName" column="user_name" />
<result property="password" column="password" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="address" column="address" />
</resultMap>
<sql id="selectUserPasswordVo">
select id, user_name, password, create_by,address, create_time, update_by, update_time, remark from sys_user_password
</sql>
<select id="selectUserPasswordList" parameterType="com.ruoyi.system.domain.UserPassword" resultMap="UserPasswordResult">
<include refid="selectUserPasswordVo"/>
<where>
<if test="userName != null and userName != ''"> and user_name = #{userName}</if>
<if test="password != null and password != ''"> and password = #{password}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
</where>
order by id desc
</select>
<select id="findUserPassword" parameterType="com.ruoyi.system.domain.UserPassword" resultMap="UserPasswordResult">
<include refid="selectUserPasswordVo"/>
<where>
<if test="userName != null and userName != ''"> and user_name = #{userName}</if>
<if test="password != null and password != ''"> and password = #{password}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
</where>
limit 1
</select>
<select id="findUserPasswordByAddress" parameterType="java.lang.String" resultMap="UserPasswordResult">
<include refid="selectUserPasswordVo"/>
where address = #{address}
</select>
<select id="selectUserPasswordById" parameterType="Integer" resultMap="UserPasswordResult">
<include refid="selectUserPasswordVo"/>
where id = #{id}
</select>
<insert id="insertUserPassword" parameterType="com.ruoyi.system.domain.UserPassword" useGeneratedKeys="true" keyProperty="id">
insert into sys_user_password
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userName != null">user_name,</if>
<if test="password != null">password,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="address != null">address,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userName != null">#{userName},</if>
<if test="password != null">#{password},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="address != null">#{address},</if>
</trim>
</insert>
<update id="updateUserPassword" parameterType="com.ruoyi.system.domain.UserPassword">
update sys_user_password
<trim prefix="SET" suffixOverrides=",">
<if test="userName != null">user_name = #{userName},</if>
<if test="password != null">password = #{password},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="address != null">address = #{address},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserPasswordByIds" parameterType="String">
delete from sys_user_password where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>