|
@@ -5,53 +5,31 @@
|
|
|
<mapper namespace="com.chuanxia.mcp.mapper.CdnDomainMapper">
|
|
|
|
|
|
<select id="getDomainByCityName" resultType="com.chuanxia.mcp.bean.model.CdnDomain">
|
|
|
- SELECT
|
|
|
- cd.id,
|
|
|
- cd.domain,
|
|
|
- cd.manufacturer,
|
|
|
- cd.default_domain as defaultDomain,
|
|
|
- cd.create_time as createTime,
|
|
|
- cd.update_time as updateTime,
|
|
|
- cd.create_by as createBy,
|
|
|
- cd.update_by as updateBy
|
|
|
+ SELECT
|
|
|
+ domain_id AS domainId,
|
|
|
+ `domain`
|
|
|
FROM
|
|
|
- `cdn_city` cc
|
|
|
- LEFT JOIN `cdn_domain_city` cdc
|
|
|
- ON cc.`id` = cdc.`city_id`
|
|
|
- LEFT JOIN `cdn_domain` cd
|
|
|
- ON cdc.`domain_id` = cd.`id`
|
|
|
- WHERE cc.`cname` = #{city}
|
|
|
+ cdn_domain_city
|
|
|
+WHERE cname = #{city}
|
|
|
LIMIT 0,1
|
|
|
</select>
|
|
|
<select id="getDomainByOperator" resultType="com.chuanxia.mcp.bean.model.CdnDomain">
|
|
|
SELECT
|
|
|
- cd.id,
|
|
|
- cd.domain,
|
|
|
- cd.manufacturer,
|
|
|
- cd.default_domain as defaultDomain,
|
|
|
- cd.create_time as createTime,
|
|
|
- cd.update_time as updateTime,
|
|
|
- cd.create_by as createBy,
|
|
|
- cd.update_by as updateBy
|
|
|
+ domain_id AS domainId,
|
|
|
+ `domain`
|
|
|
FROM
|
|
|
- `cdn_operator` co
|
|
|
- LEFT JOIN `cdn_domain_operator` cdo
|
|
|
- ON co.`id` = cdo.`operator_id`
|
|
|
- LEFT JOIN `cdn_domain` cd
|
|
|
- ON cdo.`domain_id` = cd.`id`
|
|
|
- WHERE co.`operator_name` = #{operator}
|
|
|
+ cdn_domain_operator
|
|
|
+ WHERE `operator_name` = #{operator}
|
|
|
limit 0,1
|
|
|
</select>
|
|
|
<select id="getDomainByTimeRule" resultType="com.chuanxia.mcp.bean.model.CdnDomain">
|
|
|
SELECT
|
|
|
- *
|
|
|
+ domain_id AS domainId,
|
|
|
+ `domain`
|
|
|
FROM
|
|
|
- `cdn_time_rule` ctr
|
|
|
- LEFT JOIN `cdn_domain_time_rule` cdtr
|
|
|
- ON ctr.`id` = cdtr.`id`
|
|
|
- LEFT JOIN `cdn_domain` cd
|
|
|
- ON cdtr.`domain_id` = cd.`id`
|
|
|
- WHERE ctr.`start_time` <= #{hours} and ctr.`end_time` >= #{hours}
|
|
|
- order by end_time desc limit 0,1
|
|
|
+ `cdn_domain_time_rule`
|
|
|
+ WHERE start_time <= #{hours}
|
|
|
+ AND end_time >= #{hours}
|
|
|
+ limit 0,1
|
|
|
</select>
|
|
|
</mapper>
|