<?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.nuvole.four.mapper.StoreIndustryManageMapper" >
|
<resultMap id="BaseResultMap" type="com.nuvole.four.domain.StoreIndustryManage" >
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="p_id" property="pId" jdbcType="BIGINT" />
|
<result column="industry_name" property="industryName" jdbcType="VARCHAR" />
|
<result column="industry_code" property="industryCode" jdbcType="VARCHAR" />
|
<result column="sort_no" property="sortNo" jdbcType="INTEGER" />
|
<result column="is_special" property="isSpecial" jdbcType="SMALLINT" />
|
<result column="level" property="level" jdbcType="INTEGER" />
|
<result column="status" property="status" jdbcType="SMALLINT" />
|
<result column="deleted" property="deleted" jdbcType="SMALLINT" />
|
<result column="create_by" property="createBy" jdbcType="BIGINT" />
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="update_by" property="updateBy" jdbcType="BIGINT" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
id, p_id, industry_name, industry_code, sort_no, is_special, level, status, deleted, create_by, create_time, update_by, update_time
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
select
|
<include refid="Base_Column_List" />
|
from store_industry_manage
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
update store_industry_manage set deleted = 1
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.nuvole.four.domain.StoreIndustryManage" >
|
insert into store_industry_manage (
|
id,
|
p_id,
|
industry_name,
|
industry_code,
|
sort_no,
|
is_special,
|
level,
|
status,
|
deleted,
|
create_by,
|
create_time,
|
update_by,
|
update_time
|
)
|
values (
|
#{id,jdbcType=BIGINT},
|
#{pId,jdbcType=BIGINT},
|
#{industryName,jdbcType=VARCHAR},
|
#{industryCode,jdbcType=VARCHAR},
|
#{sortNo,jdbcType=INTEGER},
|
#{isSpecial,jdbcType=SMALLINT},
|
#{level,jdbcType=INTEGER},
|
#{status,jdbcType=SMALLINT},
|
#{deleted,jdbcType=SMALLINT},
|
#{createBy,jdbcType=BIGINT},
|
#{createTime,jdbcType=TIMESTAMP},
|
#{updateBy,jdbcType=BIGINT},
|
#{updateTime,jdbcType=TIMESTAMP}
|
)
|
</insert>
|
<insert id="insertSelective" parameterType="com.nuvole.four.domain.StoreIndustryManage" >
|
insert into store_industry_manage
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="pId != null" >
|
p_id,
|
</if>
|
<if test="industryName != null" >
|
industry_name,
|
</if>
|
<if test="industryCode != null" >
|
industry_code,
|
</if>
|
<if test="sortNo != null" >
|
sort_no,
|
</if>
|
<if test="isSpecial != null" >
|
is_special,
|
</if>
|
<if test="level != null" >
|
level,
|
</if>
|
<if test="status != null" >
|
status,
|
</if>
|
<if test="deleted != null" >
|
deleted,
|
</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>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="pId != null" >
|
#{pId,jdbcType=BIGINT},
|
</if>
|
<if test="industryName != null" >
|
#{industryName,jdbcType=VARCHAR},
|
</if>
|
<if test="industryCode != null" >
|
#{industryCode,jdbcType=VARCHAR},
|
</if>
|
<if test="sortNo != null" >
|
#{sortNo,jdbcType=INTEGER},
|
</if>
|
<if test="isSpecial != null" >
|
#{isSpecial,jdbcType=SMALLINT},
|
</if>
|
<if test="level != null" >
|
#{level,jdbcType=INTEGER},
|
</if>
|
<if test="status != null" >
|
#{status,jdbcType=SMALLINT},
|
</if>
|
<if test="deleted != null" >
|
#{deleted,jdbcType=SMALLINT},
|
</if>
|
<if test="createBy != null" >
|
#{createBy,jdbcType=BIGINT},
|
</if>
|
<if test="createTime != null" >
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null" >
|
#{updateBy,jdbcType=BIGINT},
|
</if>
|
<if test="updateTime != null" >
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.nuvole.four.domain.StoreIndustryManage" >
|
update store_industry_manage
|
<set >
|
<if test="pId != null" >
|
p_id = #{pId,jdbcType=BIGINT},
|
</if>
|
<if test="industryName != null" >
|
industry_name = #{industryName,jdbcType=VARCHAR},
|
</if>
|
<if test="industryCode != null" >
|
industry_code = #{industryCode,jdbcType=VARCHAR},
|
</if>
|
<if test="sortNo != null" >
|
sort_no = #{sortNo,jdbcType=INTEGER},
|
</if>
|
<if test="isSpecial != null" >
|
is_special = #{isSpecial,jdbcType=SMALLINT},
|
</if>
|
<if test="level != null" >
|
level = #{level,jdbcType=INTEGER},
|
</if>
|
<if test="status != null" >
|
status = #{status,jdbcType=SMALLINT},
|
</if>
|
<if test="deleted != null" >
|
deleted = #{deleted,jdbcType=SMALLINT},
|
</if>
|
<if test="createBy != null" >
|
create_by = #{createBy,jdbcType=BIGINT},
|
</if>
|
<if test="createTime != null" >
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null" >
|
update_by = #{updateBy,jdbcType=BIGINT},
|
</if>
|
<if test="updateTime != null" >
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.nuvole.four.domain.StoreIndustryManage" >
|
update store_industry_manage
|
set
|
p_id = #{pId,jdbcType=BIGINT},
|
industry_name = #{industryName,jdbcType=VARCHAR},
|
industry_code = #{industryCode,jdbcType=VARCHAR},
|
sort_no = #{sortNo,jdbcType=INTEGER},
|
is_special = #{isSpecial,jdbcType=SMALLINT},
|
level = #{level,jdbcType=INTEGER},
|
status = #{status,jdbcType=SMALLINT},
|
deleted = #{deleted,jdbcType=SMALLINT},
|
create_by = #{createBy,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
update_by = #{updateBy,jdbcType=BIGINT},
|
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="selectAll" parameterType="map" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List" /> from store_industry_manage
|
<where>
|
deleted = 0
|
<choose>
|
<when test="pId != null">
|
and p_id = #{pId}
|
</when>
|
<otherwise>
|
<if test="id != null">
|
and id = #{id}
|
</if>
|
</otherwise>
|
</choose>
|
<if test="industryName != null and industryName != '' ">
|
and industry_name like CONCAT('%',#{industryName},'%')
|
</if>
|
<if test="status!=null">
|
and status = #{status}
|
</if>
|
</where>
|
</select>
|
</mapper>
|