<?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.xhkjedu.sapi.mapper.cloud.CloudMapper">
    <!--修改主题-->
    <update id="updateTheme">
        update t_cloud set theme=#{cloud.theme},loginbg=#{cloud.loginbg},loginname=#{cloud.loginname},loginico=#{cloud.loginico}
        ,tesupport=#{cloud.tesupport},recordno=#{cloud.recordno}
        where cloudid=#{cloud.cloudid}
    </update>
    <!--修改基础信息-->
    <update id="updateInfo">
      update t_cloud
      <trim prefix="set" suffixOverrides=",">
          <if test="cloud.cloudname!=null and cloud.cloudname!=''">cloudname=#{cloud.cloudname},</if>
          <if test="cloud.cloudshort!=null and cloud.cloudshort!=''">cloudshort=#{cloud.cloudshort},</if>
          <if test="cloud.account!=null and cloud.account!=''">account=#{cloud.account},</if>
          <if test="cloud.phone!=null and cloud.phone!=''">phone=#{cloud.phone},</if>
          <if test="cloud.cloudmap!=null and cloud.cloudmap!=''">cloudmap=#{cloud.cloudmap},</if>
          <if test="cloud.comm!=null and cloud.comm!=''">comm=#{cloud.comm},</if>
          <if test="cloud.cloudbindphone!=null">cloudbindphone=#{cloud.cloudbindphone},</if>
          <if test="cloud.tesupport!=null">tesupport=#{cloud.tesupport},</if>
          <if test="cloud.recordno!=null">recordno=#{cloud.recordno},</if>
          <if test="cloud.starttime!=null">starttime=#{cloud.starttime},</if>
          <if test="cloud.stoptime!=null">stoptime=#{cloud.stoptime},</if>
      </trim>
        WHERE cloudid=#{cloud.cloudid}
    </update>
    <!--获取详情-->
    <select id="getCloud" resultType="com.xhkjedu.sapi.model.cloud.TCloud">
        select *,cloudbindphone as bindphone from t_cloud limit 1
    </select>
    <!--区域学段列表-->
    <select id="listLevel" resultType="java.lang.Integer">
        select schoollevel from t_school where schoolstate=1 group by schoollevel order by schoollevel
    </select>

    <!--获取区域升级时间段限制-->
    <select id="getCloudUpTime" resultType="com.xhkjedu.sapi.model.cloud.TCloud">
        select starttime,stoptime from t_cloud limit 1
    </select>
</mapper>
