<?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.vctgo.system.mapper.SysTenantPackageMapper">

    <resultMap type="com.vctgo.system.domain.SysTenantPackage" id="SysTenantPackageResult">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="menuIds"    column="menu_ids"  />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="status"    column="status"    />
        <result property="remark"             column="remark"                />
        <result property="delFlag"            column="del_flag"              />
    </resultMap>


    <select id="getSimpleList" resultType="com.vctgo.system.domain.SysSimplePackage">
        select id, name from sys_tenant_package where 1=1 and status ='0' and del_flag='0'
    </select>
    <select id="getTenantByPackage" resultType="com.vctgo.system.api.domain.SysTenant">
        select id,tenant_name from sys_tenant where tenant_package =#{tenantpackageid}
    </select>
    <select id="getActiveTenantByPackage" resultType="java.lang.Integer">
        select count(*) from sys_tenant where tenant_package =#{tenantpackageid}
    </select>

    <delete id="deleteSysTenantPackageByIds" parameterType="String">
        delete from sys_tenant_package  where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
