|
|
@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.shop.business.mapper.UserBusinessRoleMapper">
|
|
|
|
|
|
- <resultMap type="com.ruoyi.shop.business.domain.UserBusinessRole" id="UserBusinessRoleResult">
|
|
|
+ <resultMap type="com.ruoyi.shop.business.domain.vo.UserBusinessRoleVo" id="UserBusinessRoleResult">
|
|
|
<result property="id" column="id"/>
|
|
|
<result property="businessId" column="business_id"/>
|
|
|
<result property="userId" column="user_id"/>
|
|
|
@@ -16,8 +16,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="integralTotal" column="integral_total"/>
|
|
|
<result property="integralAble" column="integral_able"/>
|
|
|
<result property="isBound" column="is_bound"/>
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
+ <association property="businessVo" javaType="com.ruoyi.business.domain.vo.BusinessVo">
|
|
|
+ <result property="businessId" column="business_id"/>
|
|
|
+ <result property="businessType" column="business_type"/>
|
|
|
+ <result property="parentBusinessId" column="parent_business_id"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="location" column="location"/>
|
|
|
+ <result property="provinceName" column="province_name"/>
|
|
|
+ <result property="cityName" column="city_name"/>
|
|
|
+ <result property="areaName" column="area_name"/>
|
|
|
+ <result property="provinceCode" column="province_code"/>
|
|
|
+ <result property="cityCode" column="city_code"/>
|
|
|
+ <result property="areaCode" column="area_code"/>
|
|
|
+ <result property="address" column="address"/>
|
|
|
+ <result property="image" column="image"/>
|
|
|
+ <result property="businessHours" column="business_hours"/>
|
|
|
+ <result property="timeQuantum" column="time_quantum"/>
|
|
|
+ <result property="orderIndex" column="order_index"/>
|
|
|
+ <result property="businessStatus" column="business_status"/>
|
|
|
+ <result property="average" column="average"/>
|
|
|
+ </association>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="totalIntegral" resultType="java.math.BigDecimal">
|
|
|
@@ -81,6 +99,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT SUM(integral_total) FROM tb_user_business_role WHERE business_id = #{businessId}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectBusinessPage" resultMap="UserBusinessRoleResult">
|
|
|
+ <include refid="queryBusiness"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectBusinessList" resultMap="UserBusinessRoleResult">
|
|
|
+ <include refid="queryBusiness"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="queryBusiness">
|
|
|
+ select r.*, b.business_name, b.business_type, b.parent_business_id,
|
|
|
+ b.location, b.province_name, b.city_name, b.area_name,
|
|
|
+ b.province_code, b.city_code, b.area_code, b.address, b.image,
|
|
|
+ b.business_hours, b.time_quantum, b.order_index, b.business_status,b.average
|
|
|
+ from tb_user_business_role r
|
|
|
+ join tb_business b on b.business_id = r.business_id
|
|
|
+ <where>
|
|
|
+ <if test="bo.businessName != null and bo.businessName != ''">
|
|
|
+ and b.business_name like concat('%', #{bo.businessName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.businessId != null">
|
|
|
+ and r.business_id = #{bo.businessId}
|
|
|
+ </if>
|
|
|
+ <if test="bo.userId != null">
|
|
|
+ and r.user_id = #{bo.userId}
|
|
|
+ </if>
|
|
|
+ <if test="bo.roleName != null and bo.roleName != ''">
|
|
|
+ and r.role_name like concat('%', #{bo.roleName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.roleCode != null and bo.roleCode != ''">
|
|
|
+ and r.role_code like concat('%', #{bo.roleCode}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.level != null">
|
|
|
+ and r.level = #{bo.level}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
<sql id="whereVerify">
|
|
|
where r.business_id = #{bo.businessId}
|
|
|
and i.bill_type = #{bo.billType}
|