shinnosuke
2026-06-23 b70eec17ac045cdc2de640092c96037f1e7b0d2e
ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/PartnerMapper.xml
@@ -8,11 +8,13 @@
      <result column="code" property="code" />
      <result column="`name`" property="name" />
      <result column="role_id" property="roleId" />
      <result column="partner_type" property="partnerType" />
      <result column="logo_url" property="logoUrl" />
      <result column="rate" property="rate" />
      <result column="icbc_partner_id" property="icbcPartnerId" />
      <result column="electricity_share_ratio" property="electricityShareRatio" />
      <result column="service_share_ratio" property="serviceShareRatio" />
      <result column="venue_share_amount" property="venueShareAmount" />
      <result column="address" property="address" />
      <result column="phone_one" property="phoneOne" />
      <result column="phone_two" property="phoneTwo" />
@@ -27,18 +29,37 @@
   
   <select id="getPartnerList" resultType="com.ruoyi.chargingPile.api.dto.PartnerListDTO">
      select
      id,
      name,
      phone_one as phoneOne,
      address,
      account,
      remark,
      electricity_share_ratio as electricityShareRatio,
      service_share_ratio as serviceShareRatio
      from t_partner where del_flag = 0
      p.id,
      p.name,
      p.partner_type as partnerType,
      p.role_id as roleId,
      r.role_name as roleName,
      p.phone_one as phoneOne,
      p.address,
      p.account,
      p.remark,
      p.electricity_share_ratio as electricityShareRatio,
      p.service_share_ratio as serviceShareRatio,
      p.venue_share_amount as venueShareAmount
      from t_partner p
      left join charging_pile_other.sys_role r on p.role_id = r.role_id
      where p.del_flag = 0
      <if test="null != item.name and '' != item.name">
         and `name` like CONCAT('%', #{item.name}, '%')
         and p.`name` like CONCAT('%', #{item.name}, '%')
      </if>
      order by create_time desc
      <if test="null != item.partnerType">
         and p.partner_type = #{item.partnerType}
      </if>
      order by p.create_time desc
   </select>
   <select id="getDefaultPartnerRoleId" resultType="java.lang.Integer">
      select role_id
      from charging_pile_other.sys_role
      where del_flag = '0'
        and status = '0'
        and role_name = #{roleName}
      order by role_id asc
      limit 1
   </select>
</mapper>