| @@ -197,38 +197,21 @@ | |||||
| and status in(2,3,4)) r | and status in(2,3,4)) r | ||||
| on m.id=r.merchant_id | on m.id=r.merchant_id | ||||
| <include refid="dynamicWhereConditionsVo"/> | <include refid="dynamicWhereConditionsVo"/> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </select> | </select> | ||||
| <select id="findListVo2" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap"> | <select id="findListVo2" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap"> | ||||
| select distinct m.* from wx_merchant m | select distinct m.* from wx_merchant m | ||||
| left join wx_merchant_b_user wmbu on wmbu.merchant_id = m.id | left join wx_merchant_b_user wmbu on wmbu.merchant_id = m.id | ||||
| where 1=1 and m.is_del=0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and m.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and m.`parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != name and ''!=name "> | |||||
| and m.`name` like concat('%', #{name},'%') | |||||
| </if> | |||||
| <if test=" null != linkPhone and ''!=linkPhone "> | |||||
| and m.`link_phone` like concat('%', #{linkPhone},'%') | |||||
| </if> | |||||
| <include refid="dynamicWhereConditionsVo"/> | |||||
| <if test=" null != phone and ''!=phone "> | <if test=" null != phone and ''!=phone "> | ||||
| and wmbu.`phone` like concat('%', #{phone},'%') | and wmbu.`phone` like concat('%', #{phone},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != businessId "> | |||||
| and m.`business_id` = #{businessId} | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and m.`status` = #{status} | |||||
| </if> | |||||
| <if test=" null != type "> | |||||
| and m.`type` = #{type} | |||||
| </if> | |||||
| <include refid="dynamicWhereConditionsVo"/> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </select> | </select> | ||||
| <sql id="dataRule"> | <sql id="dataRule"> | ||||
| @@ -272,11 +255,11 @@ | |||||
| and m.`img_url` like concat('%', #{imgUrl},'%') | and m.`img_url` like concat('%', #{imgUrl},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != name and ''!=name "> | |||||
| <if test=" null != name and '' != name "> | |||||
| and m.`name` like concat('%', #{name},'%') | and m.`name` like concat('%', #{name},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != linkPhone and ''!=linkPhone "> | |||||
| <if test=" null != linkPhone and '' != linkPhone "> | |||||
| and m.`link_phone` like concat('%', #{linkPhone},'%') | and m.`link_phone` like concat('%', #{linkPhone},'%') | ||||
| </if> | </if> | ||||
| @@ -362,7 +345,7 @@ | |||||
| </if> | </if> | ||||
| <include refid="dataRule"/> | <include refid="dataRule"/> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | </sql> | ||||
| @@ -98,6 +98,31 @@ | |||||
| <if test=" null != endDate ">and `end_date` = #{endDate}</if> | <if test=" null != endDate ">and `end_date` = #{endDate}</if> | ||||
| <if test=" null != rentShopType">and `rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType">and `rent_shop_type` = #{rentShopType}</if> | ||||
| <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | ||||
| <if test=" null != businessForRule and '' != businessForRule "> | |||||
| and business_id in (${businessForRule}) | |||||
| </if> | |||||
| <if test=" null != floorForRule and '' != floorForRule "> | |||||
| and `id` in | |||||
| <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | |||||
| select id from wx_property_contract where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select | |||||
| id from wx_shop where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and floor in (${floorForRule})) | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| @@ -135,6 +135,32 @@ | |||||
| <if test=" null != shopNumber and shopNumber!=''"> | <if test=" null != shopNumber and shopNumber!=''"> | ||||
| and shop_name like concat('%',#{shopNumber},'%') | and shop_name like concat('%',#{shopNumber},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != businessForRule and '' != businessForRule "> | |||||
| and business_id in (${businessForRule}) | |||||
| </if> | |||||
| <if test="null != floorForRule and '' != floorForRule "> | |||||
| and `id` in | |||||
| <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | |||||
| select id from wx_rent_contract where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select | |||||
| id from wx_shop where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| and floor in (${floorForRule})) | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != statuss "> | <if test=" null != statuss "> | ||||
| and status in | and status in | ||||
| <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")"> | <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")"> | ||||
| @@ -588,7 +614,7 @@ | |||||
| and rc.business_id in (${businessForRule}) | and rc.business_id in (${businessForRule}) | ||||
| </if> | </if> | ||||
| <!-- <if test="null != rentShopType and 1 == rentShopType and null != floorForRule and '' != floorForRule "> | |||||
| <if test="null != floorForRule and '' != floorForRule "> | |||||
| and rc.`id` in | and rc.`id` in | ||||
| <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")"> | ||||
| select id from wx_rent_contract where 1=1 | select id from wx_rent_contract where 1=1 | ||||
| @@ -608,7 +634,7 @@ | |||||
| </if> | </if> | ||||
| and floor in (${floorForRule})) | and floor in (${floorForRule})) | ||||
| </foreach> | </foreach> | ||||
| </if> --> | |||||
| </if> | |||||
| <!-- <if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule "> | <!-- <if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule "> | ||||
| and rc.shop_id in (select id from wx_shop where 1=1 | and rc.shop_id in (select id from wx_shop where 1=1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||