<?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.SysShopInfoDao">
|
|
|
<resultMap type="SysShopInfo" id="SysShopInfoMap">
|
<id property="id" column="ID" />
|
<result property="shopNo" column="SHOP_NO" />
|
<result property="shopName" column="SHOP_NAME" />
|
<result property="shopAddr" column="SHOP_ADDR" />
|
<result property="shopTel" column="SHOP_TEL" />
|
<result property="shopDes" column="SHOP_DES" />
|
<result property="shopImag" column="SHOP_IMAG" />
|
<result property="qrcode" column="qrcode" />
|
|
<result property="longitude" column="LONGITUDE" />
|
<result property="latitude" column="LATITUDE" />
|
<result property="rent" column="rent" />
|
<result property="companyId" column="company_id" />
|
<result property="bankNo" column="bank_no" />
|
<result property="bankName" column="bank_name" />
|
<result property="bankOwnerName" column="bank_owner_name" />
|
<result property="shopShortName" column="shop_short_name" />
|
<result property="shopType" column="shop_type" />
|
<result property="isOpenNet" column="is_open_net" />
|
|
|
</resultMap>
|
<!-- 插入方法 -->
|
<insert id="insert" parameterType="SysShopInfo"
|
useGeneratedKeys="true" keyProperty="id">
|
INSERT INTO sys_shop_info (
|
ID,
|
SHOP_NO,
|
SHOP_NAME,
|
SHOP_ADDR,
|
SHOP_TEL,
|
SHOP_DES,
|
SHOP_IMAG,
|
LONGITUDE,
|
LATITUDE,
|
rent,
|
qrcode,
|
company_id,
|
shop_short_name,
|
shop_type,
|
is_open_net,
|
bank_no,
|
bank_name,
|
bank_owner_name
|
)
|
VALUES (
|
#{id},
|
#{shopNo},
|
#{shopName},
|
#{shopAddr},
|
#{shopTel},
|
#{shopDes},
|
#{shopImag},
|
#{longitude},
|
#{latitude},
|
#{rent},
|
#{qrcode},
|
#{companyId},
|
#{shopShortName},
|
#{shopType},
|
#{isOpenNet},
|
#{bankNo},
|
#{bankName},
|
#{bankOwnerName}
|
)
|
</insert>
|
|
|
<!-- 根据id更新 部分更新 -->
|
<update id="update" >
|
UPDATE sys_shop_info
|
<set>
|
<if test="shopNo != null and shopNo !='' ">
|
SHOP_NO = #{shopNo},
|
</if>
|
<if test="shopName != null and shopName !='' ">
|
SHOP_NAME = #{shopName},
|
</if>
|
<if test="shopAddr != null and shopAddr !='' ">
|
SHOP_ADDR = #{shopAddr},
|
</if>
|
<if test="shopTel != null and shopTel !='' ">
|
SHOP_TEL = #{shopTel},
|
</if>
|
<if test="shopDes != null and shopDes !='' ">
|
SHOP_DES = #{shopDes},
|
</if>
|
<if test="shopImag != null and shopImag !='' ">
|
SHOP_IMAG = #{shopImag},
|
</if>
|
<if test="qrcode != null and qrcode !='' ">
|
qrcode = #{qrcode},
|
</if>
|
|
|
<if test="longitude != null and longitude !='' ">
|
LONGITUDE = #{longitude},
|
</if>
|
<if test="latitude != null and latitude !='' ">
|
LATITUDE = #{latitude},
|
</if>
|
<if test="rent != null and rent !='' ">
|
rent = #{rent},
|
</if>
|
<if test="bankNo != null and bankNo !='' ">
|
bank_no = #{bankNo},
|
</if>
|
<if test="bankName != null and bankName !='' ">
|
bank_name = #{bankName},
|
</if>
|
<if test="bankOwnerName != null and bankOwnerName !='' ">
|
bank_owner_name = #{bankOwnerName},
|
</if>
|
<if test="shopShortName != null and shopShortName !='' ">
|
shop_short_name = #{shopShortName},
|
</if>
|
<if test="shopType != null and shopType !='' ">
|
shop_type = #{shopType},
|
</if>
|
<if test="isOpenNet != null and isOpenNet !='' ">
|
is_open_net = #{isOpenNet},
|
</if>
|
|
</set>
|
WHERE id=#{id}
|
</update>
|
|
|
|
<!-- 批量删除 -->
|
<delete id="deleteByIds" parameterType="java.util.List">
|
delete from sys_shop_info where ID in
|
<foreach collection="list" index="index" item="item" open="("
|
separator="," close=")">
|
#{item}
|
</foreach>
|
</delete>
|
|
<!-- 根据id删除-->
|
<delete id="deleteById" >
|
DELETE FROM sys_shop_info
|
where ID=#{id}
|
</delete>
|
|
<select id="selectByShopName" resultMap="SysShopInfoMap">
|
select *
|
from sys_shop_info
|
where SHOP_NAME = #{shopName}
|
|
</select>
|
|
<!-- 分页查询 -->
|
<select id="selectInPage" resultMap="SysShopInfoMap">
|
select
|
a.*
|
from sys_shop_info a
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID = #{record.id}
|
</if>
|
<if test="record.shopNo != null and record.shopNo !='' ">
|
and SHOP_NO like CONCAT('%', #{record.shopNo},'%')
|
</if>
|
<if test="record.shopName != null and record.shopName !='' ">
|
and SHOP_NAME like CONCAT('%', #{record.shopName},'%')
|
</if>
|
|
<if test="record.shopTel != null and record.shopTel !='' ">
|
and SHOP_TEL = #{record.shopTel}
|
</if>
|
|
<if test="record.longitude != null and record.longitude !='' ">
|
and LONGITUDE = #{record.longitude}
|
</if>
|
<if test="record.latitude != null and record.latitude !='' ">
|
and LATITUDE = #{record.latitude}
|
</if>
|
|
<if test="record.shopType != null and record.shopType !='' ">
|
and shop_type = #{record.shopType}
|
</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_shop_info
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID = #{record.id}
|
</if>
|
<if test="record.shopNo != null and record.shopNo !='' ">
|
and SHOP_NO = #{record.shopNo}
|
</if>
|
<if test="record.shopName != null and record.shopName !='' ">
|
and SHOP_NAME like CONCAT('%', #{record.shopName},'%')
|
</if>
|
|
<if test="record.shopTel != null and record.shopTel !='' ">
|
and SHOP_TEL = #{record.shopTel}
|
</if>
|
|
<if test="record.longitude != null and record.longitude !='' ">
|
and LONGITUDE = #{record.longitude}
|
</if>
|
<if test="record.latitude != null and record.latitude !='' ">
|
and LATITUDE = #{record.latitude}
|
</if>
|
|
<if test="record.shopType != null and record.shopType !='' ">
|
and shop_type = #{record.shopType}
|
</if>
|
<if test="record.companyId != null and record.companyId !='' ">
|
and company_id = #{record.companyId}
|
</if>
|
|
</if>
|
</select>
|
|
<!-- 根据id查询-->
|
<select id="selectById" resultMap="SysShopInfoMap">
|
select *
|
from sys_shop_info
|
where id=#{id}
|
</select>
|
|
<select id="selectShopInfo" resultMap="SysShopInfoMap">
|
select * from sys_shop_info where shop_type != 1
|
<if test="companyId != null ">
|
and company_id=#{companyId}
|
</if>
|
</select>
|
|
|
|
|
|
<!-- 根据对象查询-->
|
<select id="selectByModel" resultMap="SysShopInfoMap">
|
select *
|
from sys_shop_info
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID = #{record.id}
|
</if>
|
<if test="record.shopNo != null and record.shopNo !='' ">
|
and SHOP_NO = #{record.shopNo}
|
</if>
|
<if test="record.shopName != null and record.shopName !='' ">
|
and SHOP_NAME like CONCAT('%', #{record.shopName},'%')
|
</if>
|
|
<if test="record.shopTel != null and record.shopTel !='' ">
|
and SHOP_TEL = #{record.shopTel}
|
</if>
|
<if test="(record.companyId!=null and record.companyId!='') ">
|
and company_id = #{record.companyId}
|
</if>
|
|
<if test="record.shopType != null and record.shopType !='' ">
|
and shop_type = #{record.shopType}
|
</if>
|
<if test="record.isOpenNet != null and record.isOpenNet !='' ">
|
and is_open_net = #{record.isOpenNet}
|
</if>
|
|
|
|
</if>
|
</select>
|
|
<select id="selectByIdAndComId" resultMap="SysShopInfoMap">
|
select * from sys_shop_info where id=#{id}
|
</select>
|
|
<select id="selectByType" resultMap="SysShopInfoMap">
|
select * from sys_shop_info where shop_type=#{shopType} and company_id=#{companyId}
|
</select>
|
|
|
<select id="selectZbShop" resultMap="SysShopInfoMap">
|
select * from sys_shop_info where shop_type=1 and company_id=#{companyId}
|
</select>
|
|
</mapper>
|