|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.huijy.management.mapper.ShopMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="Shop" id="ShopResult">
|
|
|
<result property="shopId" column="shop_id" />
|
|
|
<result property="name" column="name" />
|
|
@@ -22,15 +22,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="auditAt" column="audit_at" />
|
|
|
<result property="auditTime" column="audit_time" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
+ <result property="memberId" column="member_id" />
|
|
|
+ <result property="shopType" column="shop_type" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectShopVo">
|
|
|
- select shop_id, name, addres, lat, lng, boss_name, boss_phone, show_pictures, label_text, business_hours, brief_content, content, enable_flag, audit_flag, audit_at, audit_time, create_time from t_shop
|
|
|
+ select shop_id, name, addres, lat, lng, boss_name, boss_phone, show_pictures, label_text, business_hours, brief_content, content, enable_flag, audit_flag, audit_at, audit_time, create_time,
|
|
|
+ member_id,shop_type from t_shop
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectShopList" parameterType="Shop" resultMap="ShopResult">
|
|
|
<include refid="selectShopVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
<if test="bossName != null and bossName != ''"> and boss_name like concat('%', #{bossName}, '%')</if>
|
|
|
<if test="bossPhone != null and bossPhone != ''"> and boss_phone = #{bossPhone}</if>
|
|
@@ -38,12 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditFlag != null and auditFlag != ''"> and audit_flag = #{auditFlag}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectShopByShopId" parameterType="Long" resultMap="ShopResult">
|
|
|
<include refid="selectShopVo"/>
|
|
|
where shop_id = #{shopId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertShop" parameterType="Shop" useGeneratedKeys="true" keyProperty="shopId">
|
|
|
insert into t_shop
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -63,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditAt != null">audit_at,</if>
|
|
|
<if test="auditTime != null">audit_time,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
+ <if test="memberId != null">member_id,</if>
|
|
|
+ <if test="shopType != null">shop_type,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="name != null">#{name},</if>
|
|
@@ -81,6 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditAt != null">#{auditAt},</if>
|
|
|
<if test="auditTime != null">#{auditTime},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="memberId != null">#{memberId},</if>
|
|
|
+ <if test="shopType != null">#{shopType},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -103,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditAt != null">audit_at = #{auditAt},</if>
|
|
|
<if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="memberId != null">member_id = #{memberId},</if>
|
|
|
+ <if test="shopType != null">shop_type = #{shopType},</if>
|
|
|
</trim>
|
|
|
where shop_id = #{shopId}
|
|
|
</update>
|
|
@@ -112,9 +121,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteShopByShopIds" parameterType="String">
|
|
|
- delete from t_shop where shop_id in
|
|
|
+ delete from t_shop where shop_id in
|
|
|
<foreach item="shopId" collection="array" open="(" separator="," close=")">
|
|
|
#{shopId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <select id="selectListByMemberId" parameterType="Long" resultMap="ShopResult">
|
|
|
+ <include refid="selectShopVo"/>
|
|
|
+ where member_id = #{memberId}
|
|
|
+
|
|
|
+ </select>
|
|
|
+</mapper>
|