|
|
@@ -33,5 +33,155 @@
|
|
|
rejection_reason, delete_flag, created_user_id, updated_user_id, created_time, updated_time
|
|
|
</sql>
|
|
|
|
|
|
+ <!-- 商品表与运动健身商品表关联查询结果映射 -->
|
|
|
+ <resultMap id="StoreProductItemGymVoResultMap" type="shop.alien.entity.store.vo.StoreProductItemGymVo">
|
|
|
+ <!-- store_product_item 表字段 -->
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="pid" property="pid" />
|
|
|
+ <result column="store_id" property="storeId" />
|
|
|
+ <result column="prod_name" property="prodName" />
|
|
|
+ <result column="prod_type" property="prodType" />
|
|
|
+ <result column="images" property="images" />
|
|
|
+ <result column="image_content" property="imageContent" />
|
|
|
+ <result column="detail_content" property="detailContent" />
|
|
|
+ <result column="extra_note" property="extraNote" />
|
|
|
+ <result column="need_reserve" property="needReserve" />
|
|
|
+ <result column="reserve_rule" property="reserveRule" />
|
|
|
+ <result column="people_limit" property="peopleLimit" />
|
|
|
+ <result column="usage_rule" property="usageRule" />
|
|
|
+ <result column="status" property="status" />
|
|
|
+ <result column="rejection_reason" property="rejectionReason" />
|
|
|
+ <result column="delete_flag" property="deleteFlag" />
|
|
|
+ <result column="created_user_id" property="createdUserId" />
|
|
|
+ <result column="updated_user_id" property="updatedUserId" />
|
|
|
+ <result column="created_time" property="createdTime" />
|
|
|
+ <result column="updated_time" property="updatedTime" />
|
|
|
+ <!-- store_product_gym 表字段 -->
|
|
|
+ <result column="gym_id" property="gymId" />
|
|
|
+ <result column="ext_id" property="extId" />
|
|
|
+ <result column="gym_name" property="name" />
|
|
|
+ <result column="class_mode" property="classMode" />
|
|
|
+ <result column="available_days" property="availableDays" />
|
|
|
+ <result column="total_sessions" property="totalSessions" />
|
|
|
+ <result column="price" property="price" />
|
|
|
+ <result column="course_effect" property="courseEffect" />
|
|
|
+ <result column="suitable_people" property="suitablePeople" />
|
|
|
+ <result column="suitable_membership" property="suitableMembership" />
|
|
|
+ <result column="shower_facility" property="showerFacility" />
|
|
|
+ <result column="extra_notice" property="extraNotice" />
|
|
|
+ <result column="gym_status" property="gymStatus" />
|
|
|
+ <result column="gym_delete_flag" property="gymDeleteFlag" />
|
|
|
+ <result column="gym_created_user_id" property="gymCreatedUserId" />
|
|
|
+ <result column="gym_updated_user_id" property="gymUpdatedUserId" />
|
|
|
+ <result column="gym_created_time" property="gymCreatedTime" />
|
|
|
+ <result column="gym_updated_time" property="gymUpdatedTime" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 分页查询商品表与运动健身商品表关联数据 -->
|
|
|
+ <select id="getPageWithGym" resultMap="StoreProductItemGymVoResultMap">
|
|
|
+ SELECT
|
|
|
+ -- store_product_item 表字段
|
|
|
+ item.id,
|
|
|
+ item.pid,
|
|
|
+ item.store_id,
|
|
|
+ item.prod_name,
|
|
|
+ item.prod_type,
|
|
|
+ item.images,
|
|
|
+ item.image_content,
|
|
|
+ item.detail_content,
|
|
|
+ item.extra_note,
|
|
|
+ item.need_reserve,
|
|
|
+ item.reserve_rule,
|
|
|
+ item.people_limit,
|
|
|
+ item.usage_rule,
|
|
|
+ item.status,
|
|
|
+ item.rejection_reason,
|
|
|
+ item.delete_flag,
|
|
|
+ item.created_user_id,
|
|
|
+ item.updated_user_id,
|
|
|
+ item.created_time,
|
|
|
+ item.updated_time,
|
|
|
+ -- store_product_gym 表字段
|
|
|
+ gym.id AS gym_id,
|
|
|
+ gym.ext_id,
|
|
|
+ gym.name AS gym_name,
|
|
|
+ gym.class_mode,
|
|
|
+ gym.available_days,
|
|
|
+ gym.total_sessions,
|
|
|
+ gym.price,
|
|
|
+ gym.course_effect,
|
|
|
+ gym.suitable_people,
|
|
|
+ gym.suitable_membership,
|
|
|
+ gym.shower_facility,
|
|
|
+ gym.extra_notice,
|
|
|
+ gym.status AS gym_status,
|
|
|
+ gym.delete_flag AS gym_delete_flag,
|
|
|
+ gym.created_user_id AS gym_created_user_id,
|
|
|
+ gym.updated_user_id AS gym_updated_user_id,
|
|
|
+ gym.created_time AS gym_created_time,
|
|
|
+ gym.updated_time AS gym_updated_time
|
|
|
+ FROM store_product_item item
|
|
|
+ LEFT JOIN store_product_gym gym ON item.id = gym.ext_id AND gym.delete_flag = 0
|
|
|
+ WHERE item.delete_flag = 0
|
|
|
+ <if test="storeId != null">
|
|
|
+ AND item.store_id = #{storeId}
|
|
|
+ </if>
|
|
|
+ <if test="prodName != null and prodName != ''">
|
|
|
+ AND item.prod_name LIKE CONCAT('%', #{prodName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="prodType != null">
|
|
|
+ AND item.prod_type = #{prodType}
|
|
|
+ </if>
|
|
|
+ ORDER BY item.created_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据ID查询商品表与运动健身商品表关联详情 -->
|
|
|
+ <select id="getDetailWithGym" resultMap="StoreProductItemGymVoResultMap">
|
|
|
+ SELECT
|
|
|
+ -- store_product_item 表字段
|
|
|
+ item.id,
|
|
|
+ item.pid,
|
|
|
+ item.store_id,
|
|
|
+ item.prod_name,
|
|
|
+ item.prod_type,
|
|
|
+ item.images,
|
|
|
+ item.image_content,
|
|
|
+ item.detail_content,
|
|
|
+ item.extra_note,
|
|
|
+ item.need_reserve,
|
|
|
+ item.reserve_rule,
|
|
|
+ item.people_limit,
|
|
|
+ item.usage_rule,
|
|
|
+ item.status,
|
|
|
+ item.rejection_reason,
|
|
|
+ item.delete_flag,
|
|
|
+ item.created_user_id,
|
|
|
+ item.updated_user_id,
|
|
|
+ item.created_time,
|
|
|
+ item.updated_time,
|
|
|
+ -- store_product_gym 表字段
|
|
|
+ gym.id AS gym_id,
|
|
|
+ gym.ext_id,
|
|
|
+ gym.name AS gym_name,
|
|
|
+ gym.class_mode,
|
|
|
+ gym.available_days,
|
|
|
+ gym.total_sessions,
|
|
|
+ gym.price,
|
|
|
+ gym.course_effect,
|
|
|
+ gym.suitable_people,
|
|
|
+ gym.suitable_membership,
|
|
|
+ gym.shower_facility,
|
|
|
+ gym.extra_notice,
|
|
|
+ gym.status AS gym_status,
|
|
|
+ gym.delete_flag AS gym_delete_flag,
|
|
|
+ gym.created_user_id AS gym_created_user_id,
|
|
|
+ gym.updated_user_id AS gym_updated_user_id,
|
|
|
+ gym.created_time AS gym_created_time,
|
|
|
+ gym.updated_time AS gym_updated_time
|
|
|
+ FROM store_product_item item
|
|
|
+ LEFT JOIN store_product_gym gym ON item.id = gym.ext_id AND gym.delete_flag = 0
|
|
|
+ WHERE item.id = #{id} AND item.delete_flag = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|
|
|
|