m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`, m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`, m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked,m.entry_amount,m.cash_out_count,m.cash_out_last_time m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`, m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`, m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,r.rental_start_date,r.rental_end_date,m.entry_amount,m.cash_out_number,m.cash_out_count,m.cash_out_last_time where m.is_del = 0 and m.`id` = #{id} and m.`tenant_id` = #{tenantId} and m.`parent_tenant_id` = #{parentTenantId} and m.`img_url` like concat('%', #{imgUrl},'%') and m.`encode` like concat('%', #{encode},'%') and m.`name` like concat('%', #{name},'%') and m.`link_phone` like concat('%', #{linkPhone},'%') and m.`link_person` like concat('%', #{linkPerson},'%') and m.create_date >= #{starttime} and m.create_date <= #{endtime} and m.`car_vendor_type` = #{carVendorType} and m.`business_id` = #{businessId} and JSON_CONTAINS(m.business_types,JSON_OBJECT('id', #{businessTypes})) and m.`sub_business_id` = #{subBusinessId} and m.`car_params` like concat('%', #{carParams},'%') and m.`status` = #{status} and m.`type` = #{type} and m.`is_public` = #{isPublic} and m.`email` = #{email} and m.`is_admin` = #{isAdmin} and (m.`mark` is null or m.`mark` <> 1) and m.`mark` = 1 and m.`is_del` = #{isDel} and m.`brand` = #{brand} and m.`credit_locked` = #{creditLocked} and m.id not in( select merchant_id from wx_rent_contract where rent_shop_type=1 and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} and merchant_id is not null and status in(1,2,3,4) ) and m.id in #{idItem} and m.id in( select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms inner join wx_merchant m on ms.merchant_id = m.id inner join wx_shop s on s.id=ms.shop_id where s.is_del=0 and m.`tenant_id` = #{tenantId} and m.`parent_tenant_id` = #{parentTenantId} and m.business_id in (${businessForRule}) and s.`floor` in (${floorForRule}) ) order by ${sortColumns} and m.id in( select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms inner join wx_merchant m on ms.merchant_id = m.id inner join wx_shop s on s.id=ms.shop_id where s.is_del=0 and m.`tenant_id` = #{tenantId} and m.`parent_tenant_id` = #{parentTenantId} and m.business_id in (${businessForRule}) and s.`floor` in (${floorForRule}) ) where m.is_del = 0 and m.`id` = #{id} and m.`tenant_id` = #{tenantId} and m.`parent_tenant_id` = #{parentTenantId} and m.`img_url` like concat('%', #{imgUrl},'%') and m.`name` like concat('%', #{name},'%') and m.`encode` like concat('%', #{encode},'%') and m.`link_phone` like concat('%', #{linkPhone},'%') and m.`create_date` = #{createDate} and m.`update_date` = #{updateDate} and m.`car_vendor_type` = #{carVendorType} and m.`business_id` = #{businessId} and m.`sub_business_id` = #{subBusinessId} and m.`car_params` like concat('%', #{carParams},'%') and m.`status` = #{status} and m.`link_person` = #{linkPerson} and m.`type` = #{type} and m.`is_public` = #{isPublic} and m.`email` = #{email} and m.`is_admin` = #{isAdmin} and (m.`mark` is null or m.`mark` <> 1) and m.`mark` = 1 and m.`is_del` = #{isDel} and m.`brand` = #{brand} and m.id not in( select merchant_id from wx_rent_contract where rent_shop_type=1 and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} and merchant_id is not null and status in(1,2,3,4,8) ) and m.id in #{idItem} and m.id in( select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms inner join wx_merchant m on ms.merchant_id = m.id inner join wx_shop s on s.id=ms.shop_id where s.is_del=0 and s.`building`= #{building} and s.`floor` = #{floor} ) distinct m.id,m.img_url,m.name,m.encode,m.link_phone,m.status,m.business_id, m.is_public,m.email,m.title,m.cover_picture,m.sub_business_id, m.shop_type,m.introduction,m.action_desc,bu.title as business_name,m.link_line_phone,m.top_time update wx_merchant set credit_locked = #{creditLocked} where tenant_id = #{tenantId} update wx_merchant set cash_out_number = cash_out_number+#{cashOutNumber} where id = #{id} update wx_merchant set cash_out_number = cash_out_number-#{cashOutNumber}, cash_out_count = cash_out_count+1,cash_out_last_time = now() where id = #{id} update wx_merchant set cash_out_count = cash_out_count+1 where id = #{id} update wx_merchant set cash_out_count = 0 where id = #{id} update wx_merchant set entry_amount = ifnull(entry_amount,0)+#{entryAmount} /*,cash_out_number = ifnull(cash_out_number,0)+#{cashOutNumber}*/ where id = #{id}