Commit 3ab6e756 authored by shengnan hu's avatar shengnan hu
Browse files

init

parents
Pipeline #294 passed with stage
in 2 minutes and 13 seconds
package com.mall4j.cloud.multishop.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mall4j.cloud.api.product.vo.SpuVO;
import com.mall4j.cloud.common.serializer.ImgJsonSerializer;
import com.mall4j.cloud.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 轮播图VO
*
* @author YXF
* @date 2020-11-24 16:38:32
*/
public class IndexImgVO extends BaseVO{
private static final long serialVersionUID = 1L;
@Schema(description = "主键" )
private Long imgId;
@Schema(description = "店铺ID" )
private Long shopId;
@Schema(description = "图片" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String imgUrl;
@Schema(description = "状态" )
private Integer status;
@Schema(description = "顺序" )
private Integer seq;
@Schema(description = "关联商品id" )
private Long spuId;
@Schema(description = "图片类型 0:小程序 1:pc" )
private Integer imgType;
@Schema(description = "spu信息" )
private SpuVO spu;
public Long getImgId() {
return imgId;
}
public void setImgId(Long imgId) {
this.imgId = imgId;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getSeq() {
return seq;
}
public void setSeq(Integer seq) {
this.seq = seq;
}
public Long getSpuId() {
return spuId;
}
public void setSpuId(Long spuId) {
this.spuId = spuId;
}
public Integer getImgType() {
return imgType;
}
public void setImgType(Integer imgType) {
this.imgType = imgType;
}
public SpuVO getSpu() {
return spu;
}
public void setSpu(SpuVO spu) {
this.spu = spu;
}
@Override
public String toString() {
return "IndexImgVO{" +
"imgId=" + imgId +
",shopId=" + shopId +
",imgUrl=" + imgUrl +
",status=" + status +
",seq=" + seq +
",spuId=" + spuId +
",imgType=" + imgType +
",spu=" + spu +
",createTime=" + createTime +
",updateTime=" + updateTime +
'}';
}
}
package com.mall4j.cloud.multishop.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mall4j.cloud.api.vo.search.SpuSearchVO;
import com.mall4j.cloud.common.serializer.ImgJsonSerializer;
import com.mall4j.cloud.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
* 店铺详情VO
*
* @author FrozenWatermelon
* @date 2020-12-05 15:50:25
*/
public class ShopDetailAppVO extends BaseVO{
private static final long serialVersionUID = 1L;
@Schema(description = "店铺id" )
private Long shopId;
@Schema(description = "店铺类型1自营店 2普通店" )
private Integer type;
@Schema(description = "店铺名称" )
private String shopName;
@Schema(description = "店铺简介" )
private String intro;
@Schema(description = "店铺logo(可修改)" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String shopLogo;
@Schema(description = "店铺状态(-1:未开通 0: 停业中 1:营业中)" )
private Integer shopStatus;
@Schema(description = "营业执照" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String businessLicense;
@Schema(description = "身份证正面" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String identityCardFront;
@Schema(description = "身份证反面" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String identityCardLater;
@Schema(description = "商品列表" )
private List<SpuSearchVO> spuList;
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public String getShopLogo() {
return shopLogo;
}
public void setShopLogo(String shopLogo) {
this.shopLogo = shopLogo;
}
public Integer getShopStatus() {
return shopStatus;
}
public void setShopStatus(Integer shopStatus) {
this.shopStatus = shopStatus;
}
public String getBusinessLicense() {
return businessLicense;
}
public void setBusinessLicense(String businessLicense) {
this.businessLicense = businessLicense;
}
public String getIdentityCardFront() {
return identityCardFront;
}
public void setIdentityCardFront(String identityCardFront) {
this.identityCardFront = identityCardFront;
}
public String getIdentityCardLater() {
return identityCardLater;
}
public void setIdentityCardLater(String identityCardLater) {
this.identityCardLater = identityCardLater;
}
public List<SpuSearchVO> getSpuList() {
return spuList;
}
public void setSpuList(List<SpuSearchVO> spuList) {
this.spuList = spuList;
}
@Override
public String toString() {
return "ShopDetailAppVO{" +
"shopId=" + shopId +
", type=" + type +
", shopName='" + shopName + '\'' +
", intro='" + intro + '\'' +
", shopLogo='" + shopLogo + '\'' +
", shopStatus=" + shopStatus +
", businessLicense='" + businessLicense + '\'' +
", identityCardFront='" + identityCardFront + '\'' +
", identityCardLater='" + identityCardLater + '\'' +
", spuList=" + spuList +
'}';
}
}
/*
* Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
*
* https://www.gz-yami.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*/
package com.mall4j.cloud.multishop.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mall4j.cloud.common.serializer.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 店铺的头信息
* @author LGH
*/
public class ShopHeadInfoVO {
@Schema(description = "店铺id" )
private Long shopId;
@Schema(description = "店铺类型1自营店 2普通店" )
private Integer type;
@Schema(description = "店长用户id" )
private Long ownerUserId;
@Schema(description = "店铺名称" )
private String shopName;
@Schema(description = "店铺简介" )
private String intro;
@Schema(description = "手机号码" )
private String noticeMobile;
@Schema(description = "店铺logo(可修改)" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String shopLogo;
@Schema(description = "是否优选好店 1.是 0.不是" )
private Integer isPreferred;
@Schema(description = "店铺状态(-1:未开通 0: 停业中 1:营业中 2:平台下线 3:平台下线待审核)" )
private Integer shopStatus;
@Schema(description = "移动端背景图" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String mobileBackgroundPic;
@Schema(description = "pc背景图" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String pcBackgroundPic;
public String getMobileBackgroundPic() {
return mobileBackgroundPic;
}
public void setMobileBackgroundPic(String mobileBackgroundPic) {
this.mobileBackgroundPic = mobileBackgroundPic;
}
public String getPcBackgroundPic() {
return pcBackgroundPic;
}
public void setPcBackgroundPic(String pcBackgroundPic) {
this.pcBackgroundPic = pcBackgroundPic;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getOwnerUserId() {
return ownerUserId;
}
public void setOwnerUserId(Long ownerUserId) {
this.ownerUserId = ownerUserId;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public String getNoticeMobile() {
return noticeMobile;
}
public void setNoticeMobile(String noticeMobile) {
this.noticeMobile = noticeMobile;
}
public String getShopLogo() {
return shopLogo;
}
public void setShopLogo(String shopLogo) {
this.shopLogo = shopLogo;
}
public Integer getIsPreferred() {
return isPreferred;
}
public void setIsPreferred(Integer isPreferred) {
this.isPreferred = isPreferred;
}
public Integer getShopStatus() {
return shopStatus;
}
public void setShopStatus(Integer shopStatus) {
this.shopStatus = shopStatus;
}
@Override
public String toString() {
return "ShopHeadInfoVO{" +
"shopId=" + shopId +
", type=" + type +
", ownerUserId=" + ownerUserId +
", shopName='" + shopName + '\'' +
", intro='" + intro + '\'' +
", noticeMobile='" + noticeMobile + '\'' +
", shopLogo='" + shopLogo + '\'' +
", isPreferred=" + isPreferred +
", shopStatus=" + shopStatus +
", mobileBackgroundPic='" + mobileBackgroundPic + '\'' +
", pcBackgroundPic='" + pcBackgroundPic + '\'' +
'}';
}
}
package com.mall4j.cloud.multishop.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mall4j.cloud.common.serializer.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* @author FrozenWatermelon
* @date 2020/9/2
*/
public class ShopUserSimpleVO {
/**
* 昵称
*/
@Schema(description = "昵称" )
private String nickName;
/**
* 头像
*/
@Schema(description = "头像" )
@JsonSerialize(using = ImgJsonSerializer.class)
private String avatar;
private Integer isAdmin;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public Integer getIsAdmin() {
return isAdmin;
}
public void setIsAdmin(Integer isAdmin) {
this.isAdmin = isAdmin;
}
@Override
public String toString() {
return "ShopUserSimpleVO{" +
"nickName='" + nickName + '\'' +
", avatar='" + avatar + '\'' +
", isAdmin=" + isAdmin +
'}';
}
}
package com.mall4j.cloud.multishop.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
* @author FrozenWatermelon
* @date 2020/9/2
*/
public class ShopUserVO {
/**
* shopUserId
*/
@Schema(description = "店铺用户id" )
private Long shopUserId;
/**
* 昵称
*/
@Schema(description = "昵称" )
private String nickName;
/**
* 员工编号
*/
@Schema(description = "员工编号" )
private String code;
/**
* 联系方式
*/
@Schema(description = "联系方式" )
private String phoneNum;
@Schema(description = "是否已经有账号了" )
private Integer hasAccount;
@Schema(description = "店铺id" )
private Long shopId;
@Schema(description = "角色id列表" )
private List<Long> roleIds;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getPhoneNum() {
return phoneNum;
}
public void setPhoneNum(String phoneNum) {
this.phoneNum = phoneNum;
}
public Long getShopUserId() {
return shopUserId;
}
public void setShopUserId(Long shopUserId) {
this.shopUserId = shopUserId;
}
public Integer getHasAccount() {
return hasAccount;
}
public void setHasAccount(Integer hasAccount) {
this.hasAccount = hasAccount;
}
public List<Long> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<Long> roleIds) {
this.roleIds = roleIds;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
@Override
public String toString() {
return "ShopUserVO{" +
"shopUserId=" + shopUserId +
", nickName='" + nickName + '\'' +
", code='" + code + '\'' +
", phoneNum='" + phoneNum + '\'' +
", hasAccount=" + hasAccount +
", shopId=" + shopId +
", roleIds=" + roleIds +
'}';
}
}
server:
port: 9103
spring:
application:
name: @artifactId@
cloud:
nacos:
discovery:
server-addr: ${NACOS_HOST:192.168.1.46}:${NACOS_PORT:8848}
username: nacos
password: nacos
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
file-extension: yml
namespace: @nacos.namespace@
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
username: ${spring.cloud.nacos.discovery.username}
password: ${spring.cloud.nacos.discovery.password}
profiles:
active: @profiles.active@
<?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.mall4j.cloud.multishop.mapper.HotSearchMapper">
<resultMap id="hotSearchMap" type="com.mall4j.cloud.multishop.model.HotSearch">
<id column="hot_search_id" property="hotSearchId" />
<result column="shop_id" property="shopId"/>
<result column="content" property="content"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="seq" property="seq"/>
<result column="status" property="status"/>
<result column="title" property="title"/>
</resultMap>
<sql id="Vo_Column_List">
`hot_search_id`,`shop_id`,`content`,`create_time`,`update_time`,`seq`,`status`,`title`
</sql>
<select id="list" resultType="com.mall4j.cloud.multishop.vo.HotSearchVO">
select <include refid="Vo_Column_List"/>
from hot_search
<where>
<if test="hotSearchDTO.shopId != null ">
and shop_id = #{hotSearchDTO.shopId}
</if>
<if test="hotSearchDTO.status != null ">
and status = #{hotSearchDTO.status}
</if>
<if test="hotSearchDTO.title != null ">
and title like concat('%',#{hotSearchDTO.title}, '%')
</if>
<if test="hotSearchDTO.content != null ">
and content like concat('%',#{hotSearchDTO.content}, '%')
</if>
</where>
order by hot_search_id desc
</select>
<select id="getByHotSearchId" resultType="com.mall4j.cloud.multishop.vo.HotSearchVO">
select <include refid="Vo_Column_List"/> from hot_search where hot_search_id = #{hotSearchId}
</select>
<insert id="save">
insert into hot_search (`shop_id`,`content`,`seq`,`status`,`title`)
values (#{hotSearch.shopId},#{hotSearch.content},#{hotSearch.seq},#{hotSearch.status},#{hotSearch.title});
</insert>
<update id="update">
update hot_search
set `content` = #{hotSearch.content},`seq` = #{hotSearch.seq},`status` = #{hotSearch.status},`title` = #{hotSearch.title}
where hot_search_id = #{hotSearch.hotSearchId} and shop_id = #{hotSearch.shopId}
</update>
<delete id="deleteById">
delete from hot_search where hot_search_id = #{hotSearchId} and shop_id = #{shopId}
</delete>
<select id="listByShopId" resultType="com.mall4j.cloud.multishop.vo.HotSearchVO">
select hot_search_id,content from hot_search where shop_id = #{shopId}
</select>
</mapper>
<?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.mall4j.cloud.multishop.mapper.IndexImgMapper">
<resultMap id="indexImgMap" type="com.mall4j.cloud.multishop.model.IndexImg">
<id column="img_id" property="imgId" />
<result column="shop_id" property="shopId"/>
<result column="img_url" property="imgUrl"/>
<result column="status" property="status"/>
<result column="seq" property="seq"/>
<result column="spu_id" property="spuId"/>
<result column="img_type" property="imgType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="Vo_Column_List">
`img_id`,`shop_id`,`img_url`,`status`,`seq`,`spu_id`,`img_type`,`create_time`,`update_time`
</sql>
<select id="list" resultType="com.mall4j.cloud.multishop.vo.IndexImgVO">
select `img_id`,`img_url`,`status`,`seq`,`img_type` from index_img
<where>
<if test="indexImg.imgType != null">
and img_type = #{indexImg.imgType}
</if>
<if test="indexImg.status != null">
and `status` = #{indexImg.status}
</if>
<if test="indexImg.shopId != null">
and `shop_id` = #{indexImg.shopId}
</if>
</where>
order by seq desc,img_id desc
</select>
<select id="getByImgId" resultType="com.mall4j.cloud.multishop.vo.IndexImgVO">
select `img_id`,`shop_id`,`img_url`,`status`,`seq`,`spu_id`,`img_type` from index_img where img_id = #{imgId}
</select>
<insert id="save">
insert into index_img (`shop_id`,`img_url`,`status`,`seq`,`spu_id`,`img_type`)
values (#{indexImg.shopId},#{indexImg.imgUrl},#{indexImg.status},#{indexImg.seq},#{indexImg.spuId},#{indexImg.imgType});
</insert>
<update id="update">
update index_img
set `spu_id` = #{indexImg.spuId}, `img_url` = #{indexImg.imgUrl}, `status` = #{indexImg.status},`seq` = #{indexImg.seq},`img_type` = #{indexImg.imgType}
where img_id = #{indexImg.imgId} and shop_id = #{indexImg.shopId}
</update>
<update id="clearSpuIdBySpuId">
update index_img
set `spu_id` = null
where `spu_id` = #{spuId}
</update>
<delete id="deleteByIdAndShopId">
delete from index_img where img_id = #{imgId} and shop_id = #{shopId}
</delete>
<select id="getListByShopId" resultType="com.mall4j.cloud.multishop.vo.IndexImgVO">
select `img_id`,`img_url`,`seq`,`spu_id`,`img_type` from index_img
where `status` = 1 and shop_id = #{shopId}
order by seq desc,img_id desc
</select>
</mapper>
<?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.mall4j.cloud.multishop.mapper.ShopDetailMapper">
<resultMap id="shopDetailMap" type="com.mall4j.cloud.multishop.model.ShopDetail">
<id column="shop_id" property="shopId" />
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="type" property="type"/>
<result column="shop_name" property="shopName"/>
<result column="intro" property="intro"/>
<result column="shop_logo" property="shopLogo"/>
<result column="mobile_background_pic" property="mobileBackgroundPic"/>
<result column="shop_status" property="shopStatus"/>
<result column="business_license" property="businessLicense"/>
<result column="identity_card_front" property="identityCardFront"/>
<result column="identity_card_later" property="identityCardLater"/>
</resultMap>
<sql id="Vo_Column_List">
`shop_id`,`create_time`,`update_time`,`type`,`shop_name`,`intro`,`shop_logo`,`mobile_background_pic`,`shop_status`,`business_license`,`identity_card_front`,`identity_card_later`
</sql>
<select id="list" resultType="com.mall4j.cloud.api.multishop.vo.ShopDetailVO">
select <include refid="Vo_Column_List"/>
from shop_detail
where shop_status != -1
<if test="shopDetail.shopName">
and shop_name like concat('%', #{shopDetail.shopName}, '%')
</if>
<if test="shopDetail.shopStatus">
and shop_status = #{shopDetail.shopStatus}
</if>
order by shop_id desc
</select>
<select id="getByShopId" resultType="com.mall4j.cloud.api.multishop.vo.ShopDetailVO">
select `shop_id`,`type`,`shop_name`,`intro`,`shop_logo`,`mobile_background_pic`,`shop_status`,`business_license`,`identity_card_front`,`identity_card_later`
from shop_detail where shop_id = #{shopId}
</select>
<select id="getShoExtensionsByShopId" resultType="com.mall4j.cloud.api.multishop.vo.ShopDetailVO">
select s.`shop_id`,s.intro,s.`type`,s.`shop_name`,s.`intro`,s.`shop_logo`,s.`mobile_background_pic`,s.`shop_status`,s.`business_license`,
s.`identity_card_front`,s.`identity_card_later`,s.type,s.mobile_background_pic,s.pc_background_pic
from shop_detail s
left join shop_extension se on se.shop_id = s.shop_id
where s.shop_id = #{shopId}
</select>
<insert id="save" useGeneratedKeys="true" keyProperty="shopDetail.shopId">
insert into shop_detail (`type`,`shop_name`,`intro`,`shop_logo`,`mobile_background_pic`,`shop_status`,`business_license`,`identity_card_front`,`identity_card_later`)
values (#{shopDetail.type},#{shopDetail.shopName},#{shopDetail.intro},#{shopDetail.shopLogo},#{shopDetail.mobileBackgroundPic},#{shopDetail.shopStatus},#{shopDetail.businessLicense},#{shopDetail.identityCardFront},#{shopDetail.identityCardLater});
</insert>
<update id="update">
update shop_detail
<set>
<if test="shopDetail.type != null">
`type` = #{shopDetail.type},
</if>
<if test="shopDetail.shopName != null">
`shop_name` = #{shopDetail.shopName},
</if>
<if test="shopDetail.intro != null">
`intro` = #{shopDetail.intro},
</if>
<if test="shopDetail.shopLogo != null">
`shop_logo` = #{shopDetail.shopLogo},
</if>
<if test="shopDetail.mobileBackgroundPic != null">
`mobile_background_pic` = #{shopDetail.mobileBackgroundPic}
</if>
<if test="shopDetail.shopStatus != null">
`shop_status` = #{shopDetail.shopStatus},
</if>
<if test="shopDetail.businessLicense != null">
`business_license` = #{shopDetail.businessLicense},
</if>
<if test="shopDetail.identityCardFront != null">
`identity_card_front` = #{shopDetail.identityCardFront},
</if>
<if test="shopDetail.identityCardLater != null">
`identity_card_later` = #{shopDetail.identityCardLater},
</if>
</set>
where shop_id = #{shopDetail.shopId}
</update>
<delete id="deleteById">
delete from shop_detail where shop_id = #{shopId}
</delete>
<select id="listByShopIds" resultMap="shopDetailMap">
select `shop_id`,`shop_name`,`shop_logo` from shop_detail where shop_id in
<foreach collection="shopIds" item="shopId" open="(" close=")" separator=",">
#{shopId}
</foreach>
</select>
<select id="shopSearchList" resultType="com.mall4j.cloud.multishop.vo.ShopDetailAppVO">
select sd.shop_id,sd.type,sd.shop_name,sd.intro,sd.shop_logo from shop_detail sd
where shop_status = 1
<if test="shopDetail.shopName != null and shopDetail.shopName != ''">
and shop_name like concat('%', #{shopDetail.shopName}, '%')
</if>
order by type desc
</select>
<select id="countShopName" resultType="int">
select count(*) from shop_detail where shop_name = #{shopName} and shop_status != -1
<if test="shopId != null">
and shop_id != #{shopId}
</if>
</select>
<update id="changeSpuStatus">
update shop_detail set `shop_status` = #{shopStatus} where shop_id = #{shopId}
</update>
<select id="shopExtensionData" resultType="com.mall4j.cloud.api.multishop.bo.EsShopDetailBO">
SELECT ad.shop_id,ad.shop_name,ad.type,ad.shop_logo FROM shop_detail ad
WHERE ad.shop_id = #{shopId}
</select>
<select id="getShopDetailByShopIdAndShopName" resultType="com.mall4j.cloud.api.multishop.vo.ShopDetailVO">
SELECT ad.shop_id,ad.shop_name,ad.type,ad.shop_logo,ad.shop_status FROM shop_detail ad
WHERE ad.shop_id in
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
<if test="shopName != null and shopName != ''">
ad.shop_name like concat('%',#{shopName},'%')
</if>
</select>
</mapper>
<?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.mall4j.cloud.multishop.mapper.ShopUserMapper">
<resultMap id="BaseResultMap" type="com.mall4j.cloud.multishop.model.ShopUser">
<!--@mbg.generated-->
<!--@Table shop_user-->
<id column="shop_user_id" property="shopUserId" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="shop_id" property="shopId" />
<result column="nick_name" property="nickName" />
<result column="code" property="code" />
<result column="phone_num" property="phoneNum" />
<result column="has_account" property="hasAccount"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
shop_user_id, create_time, update_time, shop_id, nick_name,`code`,phone_num,has_account
</sql>
<select id="getByUserId" resultType="com.mall4j.cloud.multishop.vo.ShopUserVO">
select shop_user_id,nick_name,`code`,phone_num,has_account,shop_id from shop_user where shop_user_id = #{userId}
</select>
<select id="listByShopId" resultType="com.mall4j.cloud.multishop.vo.ShopUserVO">
select shop_user_id,nick_name,`code`,phone_num,has_account from shop_user
where shop_id = #{shopId}
<if test="nickName != null and nickName != ''">
and nick_name like concat('%', #{nickName}, '%')
</if>
order by shop_user_id desc
</select>
<insert id="save" useGeneratedKeys="true" keyProperty="shopUser.shopUserId">
insert into `shop_user` ( `shop_user_id`, `shop_id`, `nick_name`, `code`, `phone_num`,has_account)
values (#{shopUser.shopUserId},#{shopUser.shopId},#{shopUser.nickName},#{shopUser.code},#{shopUser.phoneNum}, #{shopUser.hasAccount});
</insert>
<update id="update">
update shop_user
<set>
<if test="shopUser.nickName != null">
nick_name = #{shopUser.nickName},
</if>
<if test="shopUser.code != null">
code = #{shopUser.code},
</if>
<if test="shopUser.phoneNum != null">
phone_num = #{shopUser.phoneNum},
</if>
<if test="shopUser.hasAccount != null">
has_account = #{shopUser.hasAccount},
</if>
</set>
where shop_user_id = #{shopUser.shopUserId} and shop_id = #{shopUser.shopId}
</update>
<delete id="deleteById">
delete from shop_user where shop_user_id = #{shopUserId}
</delete>
<select id="getUserIdByShopId" resultType="java.lang.Long">
SELECT shop_user_id FROM shop_user WHERE shop_id = #{shopId} HAVING MAX(create_time) ORDER BY shop_user_id ASC
</select>
</mapper>
server:
port: 9103
spring:
application:
name: mall4cloud-multishop
cloud:
nacos:
discovery:
server-addr: ${NACOS_HOST:192.168.1.46}:${NACOS_PORT:8848}
username: nacos
password: nacos
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
file-extension: yml
namespace:
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
username: ${spring.cloud.nacos.discovery.username}
password: ${spring.cloud.nacos.discovery.password}
profiles:
active: dev
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment