Files
love-nav/src/main/resources/mybatis/UrlCateListDao.xml
2023-12-22 10:35:16 +08:00

164 lines
5.6 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.lovenav.dao.UrlCateListDao">
<resultMap id="BaseResultMap" type="com.lovenav.entity.UrlCateList">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="createtime" jdbcType="BIGINT" property="createtime" />
<result column="url_number" jdbcType="BIGINT" property="urlNumber" />
<result column="weigh" jdbcType="BIGINT" property="weigh" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="need_login" jdbcType="TINYINT" property="needLogin" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="root_cate_id" jdbcType="INTEGER" property="rootCateId" />
<result column="ico" jdbcType="VARCHAR" property="ico" />
</resultMap>
<sql id="Base_Column_List">
id, `name`, createtime, url_number, weigh, `status`, need_login, user_id, root_cate_id,
ico
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ln_url_cate_list
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectUrListByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ln_url_cate_list
where user_id = #{userId,jdbcType=INTEGER}
</select>
<select id="selectCateByNameAnduserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ln_url_cate_list
where name = #{name ,jdbcType=VARCHAR} and user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from ln_url_cate_list
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.lovenav.entity.UrlCateList" useGeneratedKeys="true">
insert into ln_url_cate_list (`name`, createtime, url_number,
weigh, `status`, need_login,
user_id, root_cate_id, ico
)
values (#{name,jdbcType=VARCHAR}, #{createtime,jdbcType=BIGINT}, #{urlNumber,jdbcType=BIGINT},
#{weigh,jdbcType=BIGINT}, #{status,jdbcType=TINYINT}, #{needLogin,jdbcType=TINYINT},
#{userId,jdbcType=INTEGER}, #{rootCateId,jdbcType=INTEGER}, #{ico,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.lovenav.entity.UrlCateList" useGeneratedKeys="true">
insert into ln_url_cate_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
`name`,
</if>
<if test="createtime != null">
createtime,
</if>
<if test="urlNumber != null">
url_number,
</if>
<if test="weigh != null">
weigh,
</if>
<if test="status != null">
`status`,
</if>
<if test="needLogin != null">
need_login,
</if>
<if test="userId != null">
user_id,
</if>
<if test="rootCateId != null">
root_cate_id,
</if>
<if test="ico != null">
ico,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=BIGINT},
</if>
<if test="urlNumber != null">
#{urlNumber,jdbcType=BIGINT},
</if>
<if test="weigh != null">
#{weigh,jdbcType=BIGINT},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="needLogin != null">
#{needLogin,jdbcType=TINYINT},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="rootCateId != null">
#{rootCateId,jdbcType=INTEGER},
</if>
<if test="ico != null">
#{ico,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.lovenav.entity.UrlCateList">
update ln_url_cate_list
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createtime = #{createtime,jdbcType=BIGINT},
</if>
<if test="urlNumber != null">
url_number = #{urlNumber,jdbcType=BIGINT},
</if>
<if test="weigh != null">
weigh = #{weigh,jdbcType=BIGINT},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="needLogin != null">
need_login = #{needLogin,jdbcType=TINYINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="rootCateId != null">
root_cate_id = #{rootCateId,jdbcType=INTEGER},
</if>
<if test="ico != null">
ico = #{ico,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.lovenav.entity.UrlCateList">
update ln_url_cate_list
set `name` = #{name,jdbcType=VARCHAR},
createtime = #{createtime,jdbcType=BIGINT},
url_number = #{urlNumber,jdbcType=BIGINT},
weigh = #{weigh,jdbcType=BIGINT},
`status` = #{status,jdbcType=TINYINT},
need_login = #{needLogin,jdbcType=TINYINT},
user_id = #{userId,jdbcType=INTEGER},
root_cate_id = #{rootCateId,jdbcType=INTEGER},
ico = #{ico,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>