Commit 7abfefba authored by shengnan hu's avatar shengnan hu
Browse files

init

parents
Pipeline #281 passed with stage
in 1 minute and 55 seconds
<?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>
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