<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gxwebsoft.common.system.mapper.TenantPackageMapper">

  <!-- 查询所有上架的套餐 -->
  <select id="selectAvailablePackages" resultType="com.gxwebsoft.common.system.entity.TenantPackage">
    SELECT *
    FROM sys_tenant_package
    WHERE status = 1
    ORDER BY sort_number ASC, version ASC
  </select>

  <!-- 根据版本号查询套餐 -->
  <select id="selectByVersion" resultType="com.gxwebsoft.common.system.entity.TenantPackage">
    SELECT *
    FROM sys_tenant_package
    WHERE version = #{version}
      AND status = 1
    LIMIT 1
  </select>

</mapper>
