<?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.matrix.system.hive.dao.SysVipLevelDao">
|
|
<resultMap type="SysVipLevel" id="SysVipLevelMap">
|
<id property="id" column="ID" />
|
<result property="vipLevel" column="VIP_LEVEL" />
|
<result property="levelName" column="LEVEL_NAME" />
|
<result property="fundMin" column="FUND_MIN" />
|
<result property="remark" column="REMARK" />
|
<result property="effectDate" column="EFFECT_DATE" />
|
<result property="bigclass" column="BIGCLASS" />
|
<result property="shopId" column="shop_id" />
|
<result property="companyId" column="company_id" />
|
</resultMap>
|
<!-- 插入方法 -->
|
<insert id="insert" parameterType="SysVipLevel"
|
useGeneratedKeys="true" keyProperty="id">
|
INSERT INTO sys_vip_level (
|
ID,
|
VIP_LEVEL,
|
LEVEL_NAME,
|
FUND_MIN,
|
REMARK,
|
EFFECT_DATE,
|
BIGCLASS,
|
shop_id,
|
company_id
|
)
|
VALUES (
|
#{id},
|
#{vipLevel},
|
#{levelName},
|
#{fundMin},
|
#{remark},
|
#{effectDate},
|
#{bigclass},
|
#{shopId},
|
#{companyId}
|
)
|
</insert>
|
|
|
<!-- 根据id更新 部分更新 -->
|
<update id="update" >
|
UPDATE sys_vip_level
|
<set>
|
<if test="vipLevel != null and vipLevel !='' ">
|
VIP_LEVEL = #{vipLevel},
|
</if>
|
<if test="levelName != null and levelName !='' ">
|
LEVEL_NAME = #{levelName},
|
</if>
|
<if test="fundMin != null and fundMin !='' ">
|
FUND_MIN = #{fundMin},
|
</if>
|
<if test="remark != null and remark !='' ">
|
REMARK = #{remark},
|
</if>
|
<if test="effectDate != null and effectDate !='' ">
|
EFFECT_DATE = #{effectDate},
|
</if>
|
<if test="bigclass != null and bigclass !='' ">
|
BIGCLASS = #{bigclass},
|
</if>
|
</set>
|
WHERE id=#{id}
|
</update>
|
|
|
|
<!-- 批量删除 -->
|
<delete id="deleteByIds" parameterType="java.util.List">
|
delete from sys_vip_level where ID in
|
<foreach collection="list" index="index" item="item" open="("
|
separator="," close=")">
|
#{item}
|
</foreach>
|
</delete>
|
|
<!-- 根据id删除-->
|
<delete id="deleteById" >
|
DELETE FROM sys_vip_level
|
where ID=#{id}
|
</delete>
|
|
|
|
<!-- 分页查询 -->
|
<select id="selectInPage" resultMap="SysVipLevelMap">
|
select
|
ID,
|
VIP_LEVEL,
|
LEVEL_NAME,
|
FUND_MIN,
|
REMARK,
|
EFFECT_DATE,
|
BIGCLASS,
|
shop_id
|
from sys_vip_level
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID
|
</if>
|
<if test="record.vipLevel != null and record.vipLevel !='' ">
|
and VIP_LEVEL
|
</if>
|
<if test="record.levelName != null and record.levelName !='' ">
|
and LEVEL_NAME = #{record.levelName}
|
</if>
|
<if test="record.fundMin != null and record.fundMin !='' ">
|
and FUND_MIN
|
</if>
|
<if test="record.remark != null and record.remark !='' ">
|
and REMARK
|
</if>
|
<if test="record.effectDate != null and record.effectDate !='' ">
|
and EFFECT_DATE
|
</if>
|
<if test="record.bigclass != null and record.bigclass !='' ">
|
and BIGCLASS
|
</if>
|
<if test="record.shopId != null and record.shopId !='' ">
|
and shop_id = #{record.shopId}
|
</if>
|
<if test="record.companyId != null and record.companyId !='' ">
|
and company_id = #{record.companyId}
|
</if>
|
</if>
|
<if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
|
<if test="pageVo.sort !=null and pageVo.order !=null">
|
order by
|
${pageVo.sort} ${pageVo.order}
|
</if>
|
<if test="pageVo.offset >=0 and pageVo.limit >0">
|
limit
|
#{pageVo.offset},#{pageVo.limit}
|
</if>
|
</if>
|
</select>
|
|
<!-- 查询总条数 -->
|
<select id="selectTotalRecord" resultType="java.lang.Integer">
|
select count(*)
|
from sys_vip_level
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID
|
</if>
|
<if test="record.vipLevel != null and record.vipLevel !='' ">
|
and VIP_LEVEL
|
</if>
|
<if test="record.levelName != null and record.levelName !='' ">
|
and LEVEL_NAME = #{record.levelName}
|
</if>
|
<if test="record.fundMin != null and record.fundMin !='' ">
|
and FUND_MIN
|
</if>
|
<if test="record.remark != null and record.remark !='' ">
|
and REMARK
|
</if>
|
<if test="record.effectDate != null and record.effectDate !='' ">
|
and EFFECT_DATE
|
</if>
|
<if test="record.bigclass != null and record.bigclass !='' ">
|
and BIGCLASS
|
</if>
|
<if test="record.shopId != null and record.shopId !='' ">
|
and shop_id = #{record.shopId}
|
</if>
|
<if test="record.companyId != null and record.companyId !='' ">
|
and company_id = #{record.companyId}
|
</if>
|
</if>
|
</select>
|
|
<!-- 根据id查询-->
|
<select id="selectById" resultMap="SysVipLevelMap">
|
select
|
ID,
|
VIP_LEVEL,
|
LEVEL_NAME,
|
FUND_MIN,
|
REMARK,
|
EFFECT_DATE,
|
BIGCLASS,
|
shop_id
|
from sys_vip_level
|
where ID=#{id}
|
</select>
|
|
|
<!-- 根据对象查询-->
|
<select id="selectByModel" resultMap="SysVipLevelMap">
|
select
|
ID,
|
VIP_LEVEL,
|
LEVEL_NAME,
|
FUND_MIN,
|
REMARK,
|
EFFECT_DATE,
|
BIGCLASS,
|
shop_id
|
from sys_vip_level
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID
|
</if>
|
<if test="record.vipLevel != null and record.vipLevel !='' ">
|
and VIP_LEVEL
|
</if>
|
<if test="record.levelName != null and record.levelName !='' ">
|
and LEVEL_NAME = #{record.levelName}
|
</if>
|
<if test="record.fundMin != null and record.fundMin !='' ">
|
and FUND_MIN
|
</if>
|
<if test="record.remark != null and record.remark !='' ">
|
and REMARK
|
</if>
|
<if test="record.effectDate != null and record.effectDate !='' ">
|
and EFFECT_DATE
|
</if>
|
<if test="record.bigclass != null and record.bigclass !='' ">
|
and BIGCLASS
|
</if>
|
<if test="record.shopId != null and record.shopId !='' ">
|
and shop_id = #{record.shopId}
|
</if>
|
<if test="record.companyId != null and record.companyId !='' ">
|
and company_id = #{record.companyId}
|
</if>
|
</if>
|
</select>
|
</mapper>
|