|
@@ -11,6 +11,7 @@
|
|
|
<result column="email_" jdbcType="VARCHAR" property="email"/>
|
|
|
<result column="logo_" jdbcType="VARCHAR" property="logo"/>
|
|
|
<result column="customer_service_phone" jdbcType="VARCHAR" property="customerServicePhone"/>
|
|
|
+ <result column="remark_" jdbcType="VARCHAR" property="remark"/>
|
|
|
<result column="domain_name_" jdbcType="VARCHAR" property="domainName"/>
|
|
|
<result column="data_source_" jdbcType="VARCHAR" property="dataSource"/>
|
|
|
<result column="pay_state_" jdbcType="INTEGER" property="payState"/>
|
|
@@ -21,203 +22,74 @@
|
|
|
<result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <!-- <include refid="Base_Column_List"/>-->
|
|
|
<sql id="Base_Column_List">
|
|
|
id_
|
|
|
- , name_, contacts_, phone_, address_, email_, logo_, customer_service_phone, domain_name_,
|
|
|
+ , name_, contacts_, phone_, address_, email_, logo_, customer_service_phone,remark_ ,domain_name_,
|
|
|
data_source_, pay_state_, state_, created_by_, created_time_, updated_by_, updated_time_
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- from tenant_info
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="queryList" resultType="com.ym.mec.biz.dal.entity.TenantInfo">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- from tenant_info
|
|
|
- <where>
|
|
|
- <if test="param.state != null">
|
|
|
- AND state_ = #{param.state,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="param.id != null">
|
|
|
- AND id_ = #{param.id,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
- delete
|
|
|
- from tenant_info
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantInfo"
|
|
|
- useGeneratedKeys="true">
|
|
|
- insert into tenant_info (name_, contacts_, phone_,
|
|
|
- address_, email_, logo_,
|
|
|
- customer_service_phone, domain_name_, data_source_,
|
|
|
- pay_state_, state_, created_by_,
|
|
|
- created_time_, updated_by_, updated_time_)
|
|
|
- values (#{name,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
|
|
|
- #{address,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR},
|
|
|
- #{customerServicePhone,jdbcType=VARCHAR}, #{domainName,jdbcType=VARCHAR},
|
|
|
- #{dataSource,jdbcType=VARCHAR},
|
|
|
- #{payState,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{createdBy,jdbcType=INTEGER},
|
|
|
- #{createdTime,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=INTEGER}, #{updatedTime,jdbcType=TIMESTAMP})
|
|
|
- </insert>
|
|
|
+ <update id="opsTenantState" parameterType="object">
|
|
|
+ update tenant_info
|
|
|
+ set state_ = #{state}
|
|
|
+ where id_ = #{id}
|
|
|
+ </update>
|
|
|
|
|
|
- <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantInfo"
|
|
|
- useGeneratedKeys="true">
|
|
|
- insert into tenant_info
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="name != null">
|
|
|
- name_,
|
|
|
- </if>
|
|
|
- <if test="contacts != null">
|
|
|
- contacts_,
|
|
|
- </if>
|
|
|
- <if test="phone != null">
|
|
|
- phone_,
|
|
|
- </if>
|
|
|
- <if test="address != null">
|
|
|
- address_,
|
|
|
- </if>
|
|
|
- <if test="email != null">
|
|
|
- email_,
|
|
|
- </if>
|
|
|
- <if test="logo != null">
|
|
|
- logo_,
|
|
|
- </if>
|
|
|
- <if test="customerServicePhone != null">
|
|
|
- customer_service_phone,
|
|
|
- </if>
|
|
|
- <if test="domainName != null">
|
|
|
- domain_name_,
|
|
|
- </if>
|
|
|
- <if test="dataSource != null">
|
|
|
- data_source_,
|
|
|
- </if>
|
|
|
- <if test="payState != null">
|
|
|
- pay_state_,
|
|
|
- </if>
|
|
|
- <if test="state != null">
|
|
|
- state_,
|
|
|
- </if>
|
|
|
- <if test="createdBy != null">
|
|
|
- created_by_,
|
|
|
- </if>
|
|
|
- <if test="createdTime != null">
|
|
|
- created_time_,
|
|
|
- </if>
|
|
|
- <if test="updatedBy != null">
|
|
|
- updated_by_,
|
|
|
- </if>
|
|
|
- <if test="updatedTime != null">
|
|
|
- updated_time_,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="name != null">
|
|
|
- #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="contacts != null">
|
|
|
- #{contacts,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="phone != null">
|
|
|
- #{phone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="address != null">
|
|
|
- #{address,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="email != null">
|
|
|
- #{email,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="logo != null">
|
|
|
- #{logo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="customerServicePhone != null">
|
|
|
- #{customerServicePhone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="domainName != null">
|
|
|
- #{domainName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="dataSource != null">
|
|
|
- #{dataSource,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="payState != null">
|
|
|
- #{payState,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="state != null">
|
|
|
- #{state,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createdBy != null">
|
|
|
- #{createdBy,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createdTime != null">
|
|
|
- #{createdTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updatedBy != null">
|
|
|
- #{updatedBy,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="updatedTime != null">
|
|
|
- #{updatedTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
+ <resultMap id="TenantInfoInfoResult" type="com.ym.mec.biz.dal.vo.TenantInfoInfoPageVo">
|
|
|
+ <!-- 机构基础信息-->
|
|
|
+ <id column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
+ <result column="name_" jdbcType="VARCHAR" property="name"/>
|
|
|
+ <result column="contacts_" jdbcType="VARCHAR" property="contacts"/>
|
|
|
+ <result column="phone_" jdbcType="VARCHAR" property="phone"/>
|
|
|
+ <result column="pay_state_" jdbcType="INTEGER" property="payState"/>
|
|
|
+ <result column="state_" jdbcType="INTEGER" property="state"/>
|
|
|
+ <result column="real_name_" jdbcType="VARCHAR" property="createdName"/>
|
|
|
+ <!-- 机构产品信息-->
|
|
|
+ <result column="serve_name_" jdbcType="VARCHAR" property="serveName"/>
|
|
|
+ <result column="student_up_limit_" jdbcType="INTEGER" property="studentUpLimit"/>
|
|
|
+ <result column="expiry_date_" jdbcType="TIMESTAMP" property="expireDate"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
- <update id="updateByKey" parameterType="com.ym.mec.biz.dal.entity.TenantInfo">
|
|
|
- update tenant_info
|
|
|
- <set>
|
|
|
- <if test="name != null">
|
|
|
- name_ = #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="contacts != null">
|
|
|
- contacts_ = #{contacts,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="phone != null">
|
|
|
- phone_ = #{phone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="address != null">
|
|
|
- address_ = #{address,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="email != null">
|
|
|
- email_ = #{email,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="logo != null">
|
|
|
- logo_ = #{logo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="customerServicePhone != null">
|
|
|
- customer_service_phone = #{customerServicePhone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="domainName != null">
|
|
|
- domain_name_ = #{domainName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="dataSource != null">
|
|
|
- data_source_ = #{dataSource,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="payState != null">
|
|
|
- pay_state_ = #{payState,jdbcType=INTEGER},
|
|
|
+ <select id="queryPage" parameterType="map" resultMap="TenantInfoInfoResult">
|
|
|
+ SELECT a.`id_`,
|
|
|
+ a.`name_`,
|
|
|
+ a.`contacts_`,
|
|
|
+ a.`phone_`,
|
|
|
+ a.`pay_state_`,
|
|
|
+ a.`state_`,
|
|
|
+ u.`real_name_`,
|
|
|
+ c.`name_` AS serve_name_,
|
|
|
+ d.`student_up_limit_`,
|
|
|
+ b.`expiry_date_`
|
|
|
+ FROM tenant_info AS a
|
|
|
+ LEFT JOIN tenant_product_info AS b ON a.`id_` = b.`tenant_id_`
|
|
|
+ LEFT JOIN platform_serve AS c ON b.`serve_id_` = c.`id_`
|
|
|
+ LEFT JOIN platform_serve_detail AS d ON b.`serve_detail_id_` = d.`id_` AND c.`id_` = d.`serve_id_`
|
|
|
+ LEFT JOIN sys_user AS u ON a.`created_by_` = u.`id_`
|
|
|
+ <where>
|
|
|
+ <if test="param.search != null ">
|
|
|
+ AND (
|
|
|
+ a.`id_` LIKE CONCAT('%', #{param.search},'%')
|
|
|
+ OR a.`name_` LIKE CONCAT('%', #{param.search},'%')
|
|
|
+ OR a.`phone_` LIKE CONCAT('%', #{param.search},'%')
|
|
|
+ )
|
|
|
</if>
|
|
|
- <if test="state != null">
|
|
|
- state_ = #{state,jdbcType=INTEGER},
|
|
|
+ <if test="param.createdName != null ">
|
|
|
+ AND u.`real_name_` LIKE CONCAT('%', #{param.createdName},'%')
|
|
|
</if>
|
|
|
- <if test="createdBy != null">
|
|
|
- created_by_ = #{createdBy,jdbcType=INTEGER},
|
|
|
+ <if test="param.payState != null ">
|
|
|
+ AND a.`pay_state_` = #{param.payState}
|
|
|
</if>
|
|
|
- <if test="createdTime != null">
|
|
|
- created_time_ = #{createdTime,jdbcType=TIMESTAMP},
|
|
|
+ <if test="param.state != null ">
|
|
|
+ AND a.`state_` = #{param.state}
|
|
|
</if>
|
|
|
- <if test="updatedBy != null">
|
|
|
- updated_by_ = #{updatedBy,jdbcType=INTEGER},
|
|
|
+ <if test="param.startDate != null">
|
|
|
+ AND a.`created_time_` <![CDATA[ >= ]]> #{param.startDate}
|
|
|
</if>
|
|
|
- <if test="updatedTime != null">
|
|
|
- updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
|
|
|
+ <if test="param.endDate != null ">
|
|
|
+ AND a.`created_time_` <![CDATA[ <= ]]> #{param.endDate}
|
|
|
</if>
|
|
|
- </set>
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|