SELECT * from tb_pluss_merchant_store
and id = #{id}
and merchantCode in (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode =(SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
and storeId = #{storeId}
and storeName = #{storeName}
and linkName = #{linkName}
and linkPhone = #{linkPhone}
and address = #{address}
and storeDesc = #{storeDesc}
and logo = #{logo}
and creator = #{creator}
and createDt = #{createDt}
and openingTime = #{openingTime}
and status = #{status}
and merchantName = #{merchantName}
and parentCode = #{parentCode}
and email = #{email}
and isAccount = #{isAccount}
and loginName = #{loginName}
and storeHeadPic = #{storeHeadPic}
and storeInsidePic = #{storeInsidePic}
and cashPic = #{cashPic}
and productDesc = #{productDesc}
and paymentCodeUrl = #{paymentCodeUrl}
and isMarket = #{isMarket}
SELECT * from tb_pluss_merchant_store
and id = #{id}
and merchantCode = #{merchantCode}
and storeId = #{storeId}
and storeName LIKE CONCAT("%",#{storeName},"%")
and linkName = #{linkName}
and linkPhone = #{linkPhone}
and address = #{address}
and storeDesc = #{storeDesc}
and logo = #{logo}
and creator = #{creator}
and createDt = #{createDt}
and openingTime = #{openingTime}
and status = #{status}
and merchantName = #{merchantName}
and parentCode = #{parentCode}
and email = #{email}
and isAccount = #{isAccount}
and loginName = #{loginName}
and storeHeadPic = #{storeHeadPic}
and storeInsidePic = #{storeInsidePic}
and cashPic = #{cashPic}
and productDesc = #{productDesc}
and paymentCodeUrl = #{paymentCodeUrl}
order by id desc limit #{pageSize} offset #{offset}
SELECT count(*) from tb_pluss_merchant_store ms
JOIN tb_pluss_merchant_base_info mbi on ms.merchantCode = mbi.merchantCode
LEFT JOIN tb_pluss_user_app ua ON ms.merchantCode = ua.merchantCode
LEFT JOIN tb_pluss_merchant_channel_status mcs ON ms.merchantCode = mcs.merchantCode
and ms.merchantCode =#{merchantCode}
and mbi.merchantType =#{merchantType}
and ms.merchantName LIKE CONCAT('%',#{merchantName},'%')
and ms.storeName LIKE CONCAT('%',#{storeName},'%')
and (ms.status in ('1','0') OR ms.status IS NULL)
and ms.status = '2'
and mbi.productDesc=#{productDesc}
and (ms.payEcdemicSwitch = '0' OR ms.payEcdemicSwitch IS NULL)
and ms.payEcdemicSwitch='1'
and ms.address LIKE CONCAT('%',#{address},'%')
and ua.userId = #{userId}
and mbi.merchantType=#{merchantType}
and mbi.alias like concat("%",#{alias},"%")
and ms.createDt =]]> #{stTime}
and ms.createDt #{endTime}
and ms.isMarket=#{isMarket}
and mcs.`status` = #{mcsStatus}
and mcs.createTime = ]]> #{startTime}
and mcs.createTime #{endTime}
and ua.userType = 'promoter'
SELECT count(*) from tb_pluss_merchant_store ms
JOIN tb_pluss_merchant_base_info mbi on ms.merchantCode = mbi.merchantCode
LEFT JOIN tb_pluss_user_app ua ON ms.merchantCode = ua.merchantCode
and ms.merchantCode in (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode =(SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
and mbi.merchantType =#{merchantType}
and ms.merchantName LIKE CONCAT('%',#{merchantName},'%')
and ms.storeName LIKE CONCAT('%',#{storeName},'%')
and (ms.status in ('1','0') OR ms.status IS NULL)
and ms.status = '2'
and mbi.productDesc=#{productDesc}
and (ms.payEcdemicSwitch = '0' OR ms.payEcdemicSwitch IS NULL)
and ms.payEcdemicSwitch='1'
and ms.address LIKE CONCAT('%',#{address},'%')
and ua.userId = #{userId}
and mbi.merchantType=#{merchantType}
and mbi.alias like concat("%",#{alias},"%")
and ms.createDt =]]> #{stTime}
and ms.createDt #{endTime}
and ms.isMarket=#{isMarket}
and ua.userType = 'promoter'
SELECT * from tb_pluss_merchant_store
and id = #{id}
and merchantCode = #{merchantCode}
and storeId = #{storeId}
and storeName LIKE CONCAT("%",#{storeName},"%")
and linkName = #{linkName}
and linkPhone = #{linkPhone}
and address = #{address}
and storeDesc = #{storeDesc}
and logo = #{logo}
and creator = #{creator}
=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
and openingTime = #{openingTime}
and status = #{status}
and merchantName = #{merchantName}
and parentCode = #{parentCode}
and email = #{email}
and isAccount = #{isAccount}
and loginName = #{loginName}
and paymentCodeUrl = #{paymentCodeUrl}
order by id desc limit #{pageSize} offset #{offset}
SELECT count(*) from tb_pluss_merchant_store
and id = #{id}
and merchantCode = #{merchantCode}
and storeId = #{storeId}
and storeName LIKE CONCAT("%",#{storeName},"%")
and linkName = #{linkName}
and linkPhone = #{linkPhone}
and address = #{address}
and storeDesc = #{storeDesc}
and logo = #{logo}
and creator = #{creator}
=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
and openingTime = #{openingTime}
and status = #{status}
and merchantName = #{merchantName}
and parentCode = #{parentCode}
and email = #{email}
and isAccount = #{isAccount}
and loginName = #{loginName}
SELECT SQL_CALC_FOUND_ROWS
ms.id AS id,
mbi.id AS mercId,
ms.isMarket AS isMarket,
ua.userType AS userType,
ms.storeId AS storeId,
ms.storeName AS storeName,
ms.logo AS logo,
mbi.merchantName AS merchantName,
mbi.merchantType AS merchantType,
mbi.alias AS alias,
mbi.isUnionPay AS isUnionPay,
ms.`status` AS `status`,
ms.payEcdemicSwitch AS payEcdemicSwitch,
ms.merchantCode AS merchantCode,
mbi.productDesc AS productDesc,
mbi.address AS address,
mbi.md5Key AS md5Key,
mbi.subAppId AS subAppId,
mbi.appid AS appid,
IFNULL(mr.rate,38) AS rate,
mr.updateTime AS updateTime,
mr.previousRate AS previousRate,
ms.isMarket,
mbi.province,
mcs.valid validStatus,
mbi.city,
mbi.district,
t.location,
ua.userId AS userId,
(
CASE
(
SELECT
COUNT(*)
FROM
tb_pluss_merchant_base_info mi
WHERE
mi.merchantCode = ms.merchantCode
AND mi.bussAuthNum IS NOT NULL
AND mi.principalPerson IS NOT NULL
AND mi.bussAuthStartTime IS NOT NULL
AND mi.bussAuthEndTime IS NOT NULL
)
WHEN 1 THEN
'营业执照'
WHEN 0 THEN
'小微'
END
) AS storeType,
mcs.`status` AS mcsStatus,
mcs.remark AS remark,
mcs.channel AS channel,
mcs.merchantId AS merchantId,
IF(mcs.channel = 4,mcs.settlementType,'D1') AS settleType,
mcs.id as csId,
op.operatRemark as operatRemark,
mcs.createTime as incomTime
FROM
tb_pluss_merchant_store ms
LEFT JOIN (SELECT CONCAT(province,city,district,address) as location,merchantCode FROM
tb_pluss_merchant_base_info
) t ON t.merchantCode = ms.merchantCode
LEFT JOIN tb_pluss_merchant_base_info mbi ON ms.merchantCode = mbi.merchantCode
LEFT JOIN tb_pluss_merchant_rate mr ON mbi.userId = mr.userId
LEFT JOIN tb_pluss_user_app ua ON ms.merchantCode = ua.merchantCode
LEFT JOIN tb_pluss_merchant_channel_status mcs ON ms.merchantCode = mcs.merchantCode
LEFT JOIN (SELECT IF(GROUP_CONCAT(remark, '\n') = " " ,"",GROUP_CONCAT(remark, '\n')) AS operatRemark,userId
FROM
tb_pluss_operation_record WHERE dictValue IN ('KTGRDZWL', 'GBGRDZWL', 'GBSHJYGN', 'KTSHJYGN') GROUP BY userId)
op on op.userId = mbi.userId
and ua.userId = #{userId}
and ms.merchantCode = #{merchantCode}
and mbi.merchantType = #{merchantType}
and mbi.merchantName LIKE CONCAT('%',#{merchantName},'%')
and ms.storeName LIKE CONCAT('%',#{storeName},'%')
and (ms.status in ('1','0') OR ms.status IS NULL)
and ms.status = '2'
and ms.address LIKE CONCAT('%',#{address},'%')
and (ms.payEcdemicSwitch = '0' OR ms.payEcdemicSwitch IS NULL)
and ms.payEcdemicSwitch='1'
and ms.isMarket=#{isMarket}
and ms.id LIKE CONCAT('%',#{id},'%')
and mbi.merchantType=#{merchantType}
and mbi.alias like concat("%",#{alias},"%")
and t.location like concat("%",#{location},"%")
and mcs.`status` = #{mcsStatus}
and mcs.createTime = ]]> #{startTime}
and mcs.createTime #{endTime}
and userType = 'promoter'
order by ms.id desc limit #{pageSize} offset #{offset};
SELECT found_rows() as count
update tb_pluss_merchant_store ms
LEFT JOIN tb_pluss_merchant_base_info mbi
ON ms.merchantCode = mbi.merchantCode
set status=#{status}
where mbi.userId = ${id}
update tb_pluss_merchant_store ms
LEFT JOIN tb_pluss_merchant_base_info mbi
ON ms.merchantCode = mbi.merchantCode
set payEcdemicSwitch=#{payEcdemicSwitch}
where mbi.userId = ${id}
update tb_pluss_merchant_store
set isMarket = #{isMarker}
where id in
#{item}
SELECT ms.merchantCode AS merchantCode,
ms.storeId AS storeId,
ua.userId as userId,
ms.storeName as storeName
FROM tb_pluss_user_app ua
LEFT JOIN tb_pluss_merchant_store ms
on ms.merchantCode = ua.merchantCode
WHERE ua.userId = #{userId}
SELECT ms.linkPhone as linkPhone,ms.merchantName as merchantName,ms.id,ms.storeId as storeId,ms.storeName as
storeName,mbi.alias as alias,mbc.id as mbcId,ua.leshuaStatus as
leshuaStatus,ua.wechatStatus as wechatStatus,mbi.aliRate as aliRate,mbi.wechatRate as wechatRate,mbi.leshuaRate
as leshuaRate,ua.userId as userId FROM tb_pluss_merchant_store ms
LEFT JOIN tb_pluss_merchant_base_info mbi ON ms.merchantCode=mbi.merchantCode
LEFT JOIN tb_pluss_merchant_bank_card mbc ON mbc.merchantCode=ms.merchantCode
LEFT JOIN tb_pluss_user_app ua ON ua.userId=mbi.userId
and ms.storeId LIKE CONCAT('%',#{storeId},'%')
and mbi.alias LIKE CONCAT('%',#{alias},'%')
and ms.storeName LIKE CONCAT('%',#{storeName},'%')
and ms.merchantCode = #{merchantCode}
and ua.userId = #{userId}
and ms.linkPhone =#{linkPhone}
and ua.userType = 'promoter'
order by ms.id desc limit #{pageSize} offset #{offset}
select *
from tb_pluss_merchant_store
where id = #{id}
SELECT DISTINCT ms.id AS id,
mbi.id AS mercId,
ms.isMarket AS isMarket,
ua.userType AS userType,
ms.storeId AS storeId,
ms.storeName AS storeName,
ms.logo AS logo,
mbi.merchantName AS merchantName,
mbi.merchantType AS merchantType,
mbi.alias AS alias,
ms.`status` AS `status`,
ms.payEcdemicSwitch AS payEcdemicSwitch,
mbi.merchantCode AS merchantCode,
mbi.productDesc AS productDesc,
mbi.address AS address,
IFNULL(mr.rate, 38) AS rate,
mr.updateTime AS updateTime,
mr.previousRate AS previousRate,
ms.isMarket,
mbi.province,
mbi.city,
mbi.district,
t.location,
ua.userId AS userId,
(
CASE
(
SELECT COUNT(*)
FROM tb_pluss_merchant_base_info mi
WHERE mi.merchantCode = ms.merchantCode
AND mi.bussAuthNum IS NOT NULL
AND mi.principalPerson IS NOT NULL
AND mi.bussAuthStartTime IS NOT NULL
AND mi.bussAuthEndTime IS NOT NULL
)
WHEN 1 THEN
'营业执照'
WHEN 0 THEN
'小微'
END
) AS storeType,
mcs.remark AS remark,
IF(mcs.channel = 4, '0', '1') AS settleType,
mcs.id as csId
FROM tb_pluss_merchant_store ms
LEFT JOIN (SELECT CONCAT(province, city, district, address) as location, merchantCode
FROM tb_pluss_merchant_base_info
) t ON t.merchantCode = ms.merchantCode
LEFT JOIN tb_pluss_merchant_base_info mbi ON ms.merchantCode = mbi.merchantCode
LEFT JOIN tb_pluss_merchant_rate mr ON mbi.userId = mr.userId
LEFT JOIN tb_pluss_user_app ua ON ms.merchantCode = ua.merchantCode
LEFT JOIN tb_pluss_merchant_channel_status mcs ON ms.merchantCode = mcs.merchantCode
${ew.customSqlSegment}