123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <?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.yonge.cooleshow.biz.dal.mapper.TenantInfoMapper">
-
-
- <!-- 表字段 -->
- <sql id="baseColumns">
- t.id_ AS id
- , t.name_ AS name
- , t.logo_ AS logo
- , t.province_code_ AS provinceCode
- , t.city_code_ AS cityCode
- , t.region_code_ AS regionCode
- , t.username_ AS username
- , t.user_id_ AS userId
- , t.phone_ AS phone
- , t.enable_flag_ AS enableFlag
- , t.update_time_ AS updateTime
- , t.create_time_ AS createTime
- , t.brief_Introduction_ AS briefIntroduction
- </sql>
- <insert id="insertInfo" parameterType="com.yonge.cooleshow.biz.dal.entity.TenantInfo">
- insert into tenant_info
- (name_,logo_,brief_Introduction_,province_code_,city_code_,region_code_,username_,phone_)
- values (#{param.name},#{param.logo},#{param.briefIntroduction},#{param.provinceCode},#{param.cityCode},#{param.regionCode},#{param.username},#{param.phone})
- </insert>
- <update id="updateInfo">
- update tenant_info
- set
- <if test="param.name != null and param.name != ''">
- name_ = #{param.name},
- </if>
- <if test="param.logo != null and param.logo != ''">
- logo_ = #{param.logo},
- </if>
- <if test="param.provinceCode != null and param.provinceCode != ''">
- province_code_ = #{param.provinceCode},
- </if>
- <if test="param.cityCode != null and param.cityCode != ''">
- city_code_ = #{param.cityCode},
- </if>
- <if test="param.regionCode != null and param.regionCode != ''">
- region_code_ = #{param.regionCode},
- </if>
- <if test="param.briefIntroduction != null and param.briefIntroduction != ''">
- brief_introduction_= #{param.briefIntroduction},
- </if>
- <if test="param.username != null and param.username != ''">
- username_ = #{param.username},
- </if>
- <if test="param.phone != null and param.phone != ''">
- phone_ = #{param.phone}
- </if>
- WHERE id_ = #{param.id}
- </update>
- <update id="updateFlag">
- update tenant_info
- set enable_flag_ = 0
- where id_ = #{id}
- </update>
- <update id="updateMethod">
- update teacher
- set settlement_from_ = 'TEACHER'
- where tenant_id_ = #{id}
- </update>
- <update id="updateStatusById">
- update tenant_apply_record
- set status_ = 'PASS'
- where id_ =#{id}
- </update>
- <update id="updateUnpassStatusById">
- update tenant_apply_record
- set status_ = 'UNPASS'
- where id_ =#{id}
- </update>
- <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper$TenantInfo">
- SELECT
- <include refid="baseColumns"/>
- FROM tenant_info t
- <where>
- <if test="param.keyword != null and param.keyword != ''">
- and (
- t.name_ like concat('%',#{param.keyword},'%')
- or t.username_ like concat('%',#{param.keyword},'%')
- or t.phone_ like concat('%',#{param.keyword},'%')
- )
- </if>
- <if test="param.provinceCode != null">
- and t.province_code_ = #{param.provinceCode}
- </if>
- <if test="param.cityCode != null">
- and t.city_code_ = #{param.cityCode}
- </if>
- <if test="param.regionCode != null">
- and t.region_code_ = #{param.regionCode}
- </if>
- </where>
- </select>
- <select id="queryTeacherCounts" resultType="java.lang.Integer">
- SELECT count(t.tenant_id_) FROM teacher t where t.tenant_id_ IN (<foreach collection="listId" separator="," item="Id">#{Id}</foreach>)
- </select>
- <select id="queryTeacherCount" resultType="java.lang.String">
- SELECT count(t.tenant_id_) FROM teacher t where t.tenant_id_ = #{id}
- </select>
- <select id="queryStudentCounts" resultType="java.lang.Integer">
- SELECT count(s.tenant_id_) FROM student s where s.tenant_id_ IN (<foreach collection="listId" separator="," item="Id">#{Id}</foreach>)
- </select>
- <select id="queryStudentCount" resultType="java.lang.String">
- SELECT count(s.tenant_id_) FROM student s where s.tenant_id_ = #{id}
- </select>
- <select id="selectApplyPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper$TenantInfo">
- SELECT
- id_ as id,
- name_ AS name,
- logo_ AS logo,
- brief_Introduction_ AS briefIntroduction,
- username_ AS username,
- phone_ AS phone,
- province_code_ AS provinceCode,
- city_code_ AS cityCode,
- region_code_ AS regionCode,
- status_ AS status
- FROM tenant_apply_record t
- where 1=1
- <if test="param.keyword != null and param.keyword != ''">
- and (
- t.name_ like concat('%',#{param.keyword},'%')
- or t.username_ like concat('%',#{param.keyword},'%')
- or t.phone_ like concat('%',#{param.keyword},'%')
- )
- </if>
- <if test="param.provinceCode != null and param.provinceCode != ''
- and param.cityCode != null and param.cityCode != ''
- and param.regionCode != null and param.regionCode != ''">
- and
- t.province_code_ = #{param.provinceCode}
- and
- t.city_code_ = #{param.cityCode}
- and
- t.region_code_ = #{param.regionCode}
- </if>
- </select>
- <select id="selectHistoryPage"
- resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper$TenantInfo">
- select
- id_ AS id,
- tenant_apply_record_id_ AS tenantApplyRecordId,
- name_ AS name,
- logo_ as logo,
- province_code_ AS provinceCode,
- city_code_ AS cityCode,
- region_code_ AS regionCode,
- username_ AS username,
- phone_ AS phone,
- status_ AS status,
- verify_user_id_ AS verifyUserId,
- reason_ AS reason,
- update_time_ AS updateTime,
- create_time_ AS createTime
- FROM
- tenant_entry_record
- WHERE
- 1=1
- <if test="id != null">
- and id_ = #{id}
- </if>
- </select>
- <select id="queryNow" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper$TenantInfo">
- select
- id_ AS id,
- tenant_id_ AS tenantId,
- name_ AS name,
- logo_ as logo,
- province_code_ AS provinceCode,
- city_code_ AS cityCode,
- region_code_ AS regionCode,
- username_ AS username,
- phone_ AS phone,
- status_ AS status,
- verify_user_id_ AS verifyUserId,
- reason_ AS reason,
- update_time_ AS updateTime,
- create_time_ AS createTime
- from
- tenant_apply_record
- where
- 1=1
- <if test="param.id != null">
- and
- id_ = #{param.id}
- </if>
- </select>
- <select id="selectInfoById" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper$TenantInfo">
- select
- t.id_ AS id
- , t.name_ AS name
- , t.logo_ AS logo
- , t.province_code_ AS provinceCode
- , t.city_code_ AS cityCode
- , t.region_code_ AS regionCode
- , t.username_ AS userName
- , t.user_id_ AS userId
- , t.phone_ AS phone
- , t.update_time_ AS updateTime
- , t.create_time_ AS createTime
- , t.brief_Introduction_ AS briefIntroduction
- from tenant_info t
- where 1=1
- <if test="id != null">
- id_ = #{id}
- </if>
- }
- </select>
- </mapper>
|