实体层,dao层基本创建
This commit is contained in:
87
src/main/resources/generator/LoginLogsDao.xml
Normal file
87
src/main/resources/generator/LoginLogsDao.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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.lovenav.mapper.LoginLogsDao">
|
||||
<resultMap id="BaseResultMap" type="com.lovenav.entity.LoginLogs">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="login_ip" jdbcType="VARCHAR" property="loginIp" />
|
||||
<result column="user_id" jdbcType="TINYINT" property="userId" />
|
||||
<result column="login_time" jdbcType="TIMESTAMP" property="loginTime" />
|
||||
<result column="location" jdbcType="VARCHAR" property="location" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, login_ip, user_id, login_time, `location`
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from ln_login_logs
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from ln_login_logs
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.lovenav.entity.LoginLogs" useGeneratedKeys="true">
|
||||
insert into ln_login_logs (login_ip, user_id, login_time,
|
||||
`location`)
|
||||
values (#{loginIp,jdbcType=VARCHAR}, #{userId,jdbcType=TINYINT}, #{loginTime,jdbcType=TIMESTAMP},
|
||||
#{location,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.lovenav.entity.LoginLogs" useGeneratedKeys="true">
|
||||
insert into ln_login_logs
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="loginIp != null">
|
||||
login_ip,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="loginTime != null">
|
||||
login_time,
|
||||
</if>
|
||||
<if test="location != null">
|
||||
`location`,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="loginIp != null">
|
||||
#{loginIp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="loginTime != null">
|
||||
#{loginTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="location != null">
|
||||
#{location,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.lovenav.entity.LoginLogs">
|
||||
update ln_login_logs
|
||||
<set>
|
||||
<if test="loginIp != null">
|
||||
login_ip = #{loginIp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="loginTime != null">
|
||||
login_time = #{loginTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="location != null">
|
||||
`location` = #{location,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.lovenav.entity.LoginLogs">
|
||||
update ln_login_logs
|
||||
set login_ip = #{loginIp,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=TINYINT},
|
||||
login_time = #{loginTime,jdbcType=TIMESTAMP},
|
||||
`location` = #{location,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
Reference in New Issue
Block a user