You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
344 lines
13 KiB
344 lines
13 KiB
<?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="cc.hiver.mall.dao.mapper.ShopMapper" >
|
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.entity.Shop" >
|
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
|
<result column="create_by" property="createBy" jdbcType="VARCHAR" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
|
|
<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
|
<result column="shop_name" property="shopName" jdbcType="VARCHAR" />
|
|
<result column="shop_owner_id" property="shopOwnerId" jdbcType="VARCHAR" />
|
|
<result column="shop_manger_id" property="shopMangerId" jdbcType="VARCHAR" />
|
|
<result column="shop_area" property="shopArea" jdbcType="VARCHAR" />
|
|
<result column="shop_address" property="shopAddress" jdbcType="VARCHAR" />
|
|
<result column="year_fee" property="yearFee" jdbcType="VARCHAR" />
|
|
<result column="charge_time" property="chargeTime" jdbcType="VARCHAR" />
|
|
<result column="start_time" property="startTime" jdbcType="VARCHAR" />
|
|
<result column="end_time" property="endTime" jdbcType="VARCHAR" />
|
|
<result column="status" property="status" jdbcType="INTEGER" />
|
|
<result column="business_district_level" property="businessDistrictLevel" jdbcType="VARCHAR" />
|
|
<result column="contact_phone" property="contactPhone" jdbcType="VARCHAR" />
|
|
<result column="shop_icon" property="shopIcon" jdbcType="VARCHAR" />
|
|
<result column="defaulted" property="defaulted" jdbcType="INTEGER" />
|
|
<result column="region" property="region" jdbcType="VARCHAR" />
|
|
<result column="shop_area_title" property="shopAreaTitle" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
<resultMap id="ResultMapWithBLOBs" type="cc.hiver.mall.entity.Shop" extends="BaseResultMap" >
|
|
<result column="remark" property="remark" jdbcType="LONGVARCHAR" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List" >
|
|
id, create_by, create_time, del_flag, update_by, update_time, shop_name, shop_owner_id,
|
|
shop_manger_id, shop_area, shop_address, year_fee, charge_time, start_time, end_time,
|
|
status, business_district_level, contact_phone, shop_icon, defaulted, region, shop_area_title
|
|
</sql>
|
|
<sql id="Blob_Column_List" >
|
|
remark
|
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
,
|
|
<include refid="Blob_Column_List" />
|
|
from t_shop
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
delete from t_shop
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</delete>
|
|
<insert id="insert" parameterType="cc.hiver.mall.entity.Shop" >
|
|
insert into t_shop (id, create_by, create_time,
|
|
del_flag, update_by, update_time,
|
|
shop_name, shop_owner_id, shop_manger_id,
|
|
shop_area, shop_address, year_fee,
|
|
charge_time, start_time, end_time,
|
|
status, business_district_level, contact_phone,
|
|
shop_icon, defaulted, region,
|
|
shop_area_title, remark)
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
#{shopName,jdbcType=VARCHAR}, #{shopOwnerId,jdbcType=VARCHAR}, #{shopMangerId,jdbcType=VARCHAR},
|
|
#{shopArea,jdbcType=VARCHAR}, #{shopAddress,jdbcType=VARCHAR}, #{yearFee,jdbcType=VARCHAR},
|
|
#{chargeTime,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR},
|
|
#{status,jdbcType=INTEGER}, #{businessDistrictLevel,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR},
|
|
#{shopIcon,jdbcType=VARCHAR}, #{defaulted,jdbcType=INTEGER}, #{region,jdbcType=VARCHAR},
|
|
#{shopAreaTitle,jdbcType=VARCHAR}, #{remark,jdbcType=LONGVARCHAR})
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Shop" >
|
|
insert into t_shop
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >
|
|
id,
|
|
</if>
|
|
<if test="createBy != null" >
|
|
create_by,
|
|
</if>
|
|
<if test="createTime != null" >
|
|
create_time,
|
|
</if>
|
|
<if test="delFlag != null" >
|
|
del_flag,
|
|
</if>
|
|
<if test="updateBy != null" >
|
|
update_by,
|
|
</if>
|
|
<if test="updateTime != null" >
|
|
update_time,
|
|
</if>
|
|
<if test="shopName != null" >
|
|
shop_name,
|
|
</if>
|
|
<if test="shopOwnerId != null" >
|
|
shop_owner_id,
|
|
</if>
|
|
<if test="shopMangerId != null" >
|
|
shop_manger_id,
|
|
</if>
|
|
<if test="shopArea != null" >
|
|
shop_area,
|
|
</if>
|
|
<if test="shopAddress != null" >
|
|
shop_address,
|
|
</if>
|
|
<if test="yearFee != null" >
|
|
year_fee,
|
|
</if>
|
|
<if test="chargeTime != null" >
|
|
charge_time,
|
|
</if>
|
|
<if test="startTime != null" >
|
|
start_time,
|
|
</if>
|
|
<if test="endTime != null" >
|
|
end_time,
|
|
</if>
|
|
<if test="status != null" >
|
|
status,
|
|
</if>
|
|
<if test="businessDistrictLevel != null" >
|
|
business_district_level,
|
|
</if>
|
|
<if test="contactPhone != null" >
|
|
contact_phone,
|
|
</if>
|
|
<if test="shopIcon != null" >
|
|
shop_icon,
|
|
</if>
|
|
<if test="defaulted != null" >
|
|
defaulted,
|
|
</if>
|
|
<if test="region != null" >
|
|
region,
|
|
</if>
|
|
<if test="shopAreaTitle != null" >
|
|
shop_area_title,
|
|
</if>
|
|
<if test="remark != null" >
|
|
remark,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >
|
|
#{id,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createBy != null" >
|
|
#{createBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null" >
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="delFlag != null" >
|
|
#{delFlag,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="updateBy != null" >
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updateTime != null" >
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="shopName != null" >
|
|
#{shopName,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopOwnerId != null" >
|
|
#{shopOwnerId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopMangerId != null" >
|
|
#{shopMangerId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopArea != null" >
|
|
#{shopArea,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopAddress != null" >
|
|
#{shopAddress,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="yearFee != null" >
|
|
#{yearFee,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="chargeTime != null" >
|
|
#{chargeTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="startTime != null" >
|
|
#{startTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="endTime != null" >
|
|
#{endTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="status != null" >
|
|
#{status,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="businessDistrictLevel != null" >
|
|
#{businessDistrictLevel,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="contactPhone != null" >
|
|
#{contactPhone,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopIcon != null" >
|
|
#{shopIcon,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="defaulted != null" >
|
|
#{defaulted,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="region != null" >
|
|
#{region,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopAreaTitle != null" >
|
|
#{shopAreaTitle,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="remark != null" >
|
|
#{remark,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.Shop" >
|
|
update t_shop
|
|
<set >
|
|
<if test="createBy != null" >
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null" >
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="delFlag != null" >
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="updateBy != null" >
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updateTime != null" >
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="shopName != null" >
|
|
shop_name = #{shopName,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopOwnerId != null" >
|
|
shop_owner_id = #{shopOwnerId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopMangerId != null" >
|
|
shop_manger_id = #{shopMangerId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopArea != null" >
|
|
shop_area = #{shopArea,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopAddress != null" >
|
|
shop_address = #{shopAddress,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="yearFee != null" >
|
|
year_fee = #{yearFee,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="chargeTime != null" >
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="startTime != null" >
|
|
start_time = #{startTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="endTime != null" >
|
|
end_time = #{endTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="status != null" >
|
|
status = #{status,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="businessDistrictLevel != null" >
|
|
business_district_level = #{businessDistrictLevel,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="contactPhone != null" >
|
|
contact_phone = #{contactPhone,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopIcon != null" >
|
|
shop_icon = #{shopIcon,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="defaulted != null" >
|
|
defaulted = #{defaulted,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="region != null" >
|
|
region = #{region,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopAreaTitle != null" >
|
|
shop_area_title = #{shopAreaTitle,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="remark != null" >
|
|
remark = #{remark,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="cc.hiver.mall.entity.Shop" >
|
|
update t_shop
|
|
set create_by = #{createBy,jdbcType=VARCHAR},
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
shop_name = #{shopName,jdbcType=VARCHAR},
|
|
shop_owner_id = #{shopOwnerId,jdbcType=VARCHAR},
|
|
shop_manger_id = #{shopMangerId,jdbcType=VARCHAR},
|
|
shop_area = #{shopArea,jdbcType=VARCHAR},
|
|
shop_address = #{shopAddress,jdbcType=VARCHAR},
|
|
year_fee = #{yearFee,jdbcType=VARCHAR},
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
start_time = #{startTime,jdbcType=VARCHAR},
|
|
end_time = #{endTime,jdbcType=VARCHAR},
|
|
status = #{status,jdbcType=INTEGER},
|
|
business_district_level = #{businessDistrictLevel,jdbcType=VARCHAR},
|
|
contact_phone = #{contactPhone,jdbcType=VARCHAR},
|
|
shop_icon = #{shopIcon,jdbcType=VARCHAR},
|
|
defaulted = #{defaulted,jdbcType=INTEGER},
|
|
region = #{region,jdbcType=VARCHAR},
|
|
shop_area_title = #{shopAreaTitle,jdbcType=VARCHAR},
|
|
remark = #{remark,jdbcType=LONGVARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.Shop" >
|
|
update t_shop
|
|
set create_by = #{createBy,jdbcType=VARCHAR},
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
shop_name = #{shopName,jdbcType=VARCHAR},
|
|
shop_owner_id = #{shopOwnerId,jdbcType=VARCHAR},
|
|
shop_manger_id = #{shopMangerId,jdbcType=VARCHAR},
|
|
shop_area = #{shopArea,jdbcType=VARCHAR},
|
|
shop_address = #{shopAddress,jdbcType=VARCHAR},
|
|
year_fee = #{yearFee,jdbcType=VARCHAR},
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
start_time = #{startTime,jdbcType=VARCHAR},
|
|
end_time = #{endTime,jdbcType=VARCHAR},
|
|
status = #{status,jdbcType=INTEGER},
|
|
business_district_level = #{businessDistrictLevel,jdbcType=VARCHAR},
|
|
contact_phone = #{contactPhone,jdbcType=VARCHAR},
|
|
shop_icon = #{shopIcon,jdbcType=VARCHAR},
|
|
defaulted = #{defaulted,jdbcType=INTEGER},
|
|
region = #{region,jdbcType=VARCHAR},
|
|
shop_area_title = #{shopAreaTitle,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
<select id="findByUserId" resultType="cc.hiver.mall.entity.Shop">
|
|
SELECT DISTINCT m.*
|
|
FROM t_shop m
|
|
LEFT JOIN t_shop_user um ON m.id = um.shop_id
|
|
WHERE m.status = 1 AND (um.user_id = #{userId} OR m.shop_owner_id = #{userId} OR m.shop_manger_id = #{userId})
|
|
ORDER BY m.defaulted DESC
|
|
</select>
|
|
</mapper>
|