ソースを参照

机构:
增加机构信息相关功能

hgw 3 年 前
コミット
c881d6d5d5

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PlatformServeDao.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ym.mec.biz.dal.entity.PlatformServe;
 import com.ym.mec.biz.dal.vo.PlatformServeInfoVo;
-import io.swagger.models.auth.In;
 import org.apache.ibatis.annotations.Param;
 
 public interface PlatformServeDao extends BaseMapper<PlatformServe> {

+ 17 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantInfoDao.java

@@ -1,9 +1,23 @@
 package com.ym.mec.biz.dal.dao;
 
-import com.ym.mec.common.dal.BaseDAO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.biz.dal.entity.TenantInfo;
+import org.apache.ibatis.annotations.Param;
 
-public interface TenantInfoDao extends BaseDAO<Integer, TenantInfo> {
+import java.util.List;
+import java.util.Map;
 
-	
+public interface TenantInfoDao extends BaseMapper<TenantInfo> {
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(TenantInfo record);
+
+    int insertSelective(TenantInfo record);
+
+    TenantInfo selectByPrimaryKey(Integer id);
+
+    int updateByKey(TenantInfo record);
+
+    List<TenantInfo> queryList(@Param("param") Map<String, Object> param);
 }

+ 73 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantInfoDto.java

@@ -1,50 +1,107 @@
 package com.ym.mec.biz.dal.dto;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
 import java.io.Serializable;
 
 /**
  * @author hgw
  * Created by 2021-12-02
  */
+@ApiModel(value = "机构参数")
 public class TenantInfoDto implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
     /**
+     * 机构id
+     */
+    @ApiModelProperty(value = "机构id")
+    private Integer id;
+
+    /**
      * 机构名称
      */
+    @NotBlank(message = "机构名称不能为空")
+    @Size(max = 50, message = "机构名称长度不能超过50!")
+    @ApiModelProperty(value = "机构名称")
     private String name;
 
     /**
      * 机构联系人
      */
+    @NotBlank(message = "机构联系人不能为空")
+    @Size(max = 14, message = "机构联系人长度不能超过14!")
+    @ApiModelProperty(value = "机构联系人")
     private String contacts;
 
     /**
      * 机构联系人电话
      */
+    @NotBlank(message = "机构联系人电话不能为空!")
+    @Size(max = 13, message = "联系人电话手机号最高11位,座机号最高为13位,请核实后在填写!")
+    @Pattern(regexp = "^[0-9|-]*$", message = "联系人电话只能填写数字")
+    @ApiModelProperty(value = "机构联系人电话")
     private String phone;
 
     /**
      * 地址
      */
+    @NotBlank(message = "地址不能为空!")
+    @Size(max = 200, message = "地址长度不能超过200个字!")
+    @ApiModelProperty(value = "地址")
     private String address;
 
     /**
      * 机构邮箱
      */
+    @NotBlank(message = "邮箱不能为空!")
+    @Email(message = "邮箱格式不正确!")
+    @Size(max = 64, message = "邮箱长度不能超过64位!")
+    @ApiModelProperty(value = "机构邮箱")
     private String email;
 
     /**
      * 机构logo
      */
+    @ApiModelProperty(value = "机构logo")
     private String logo;
 
     /**
      * 客服电话
      */
+    @NotBlank(message = "客服电话不能为空!")
+    @Size(max = 13, message = "客服电话电话-手机号最高11位、座机号最高为13位,请核实后再填写!")
+    @Pattern(regexp = "^[0-9]*$", message = "客服电话电话只能填写数字!")
+    @ApiModelProperty(value = "客服电话")
     private String customerServicePhone;
 
+    /**
+     * 域名
+     */
+    @ApiModelProperty(value = "域名")
+    private String domainName;
+
+    /**
+     * 数据源
+     */
+    @ApiModelProperty(value = "数据源")
+    private String dataSource;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
     public String getName() {
         return name;
     }
@@ -100,4 +157,20 @@ public class TenantInfoDto implements Serializable {
     public void setCustomerServicePhone(String customerServicePhone) {
         this.customerServicePhone = customerServicePhone;
     }
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public void setDomainName(String domainName) {
+        this.domainName = domainName;
+    }
+
+    public String getDataSource() {
+        return dataSource;
+    }
+
+    public void setDataSource(String dataSource) {
+        this.dataSource = dataSource;
+    }
 }

+ 51 - 20
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantInfo.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.io.Serializable;
@@ -9,85 +11,106 @@ import java.util.Date;
  * 机构信息表
  * 对应数据库表(tenant_info):
  */
+@ApiModel(value="TenantInfo机构表")
 public class TenantInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
     /**
      * 机构id
      */
+    @ApiModelProperty(value="机构id")
     private Integer id;
 
     /**
      * 机构名称
      */
+    @ApiModelProperty(value="机构名称")
     private String name;
 
     /**
      * 机构联系人
      */
+    @ApiModelProperty(value="机构联系人")
     private String contacts;
 
     /**
      * 机构联系人电话
      */
+    @ApiModelProperty(value="机构联系人电话")
     private String phone;
 
     /**
      * 地址
      */
+    @ApiModelProperty(value="地址")
     private String address;
 
     /**
      * 机构邮箱
      */
+    @ApiModelProperty(value="机构邮箱")
     private String email;
 
     /**
      * 机构logo
      */
+    @ApiModelProperty(value="机构logo")
     private String logo;
 
     /**
      * 客服电话
      */
+    @ApiModelProperty(value="客服电话")
     private String customerServicePhone;
 
     /**
      * 域名
      */
+    @ApiModelProperty(value="域名")
     private String domainName;
 
     /**
      * 数据源
      */
+    @ApiModelProperty(value="数据源")
     private String dataSource;
 
     /**
+     * 缴费状态 0未缴费  1已缴费
+     */
+    @ApiModelProperty(value="缴费状态 0未缴费  1已缴费")
+    private Integer payState;
+
+    /**
      * 状态0 草稿 1启动 2停用
      */
+    @ApiModelProperty(value="状态0 草稿 1启动 2停用")
     private Integer state;
 
     /**
      * 创建人
      */
+    @ApiModelProperty(value="创建人")
     private Integer createdBy;
 
     /**
      * 创建时间
      */
+    @ApiModelProperty(value="创建时间")
     private Date createdTime;
 
     /**
      * 更新人
      */
+    @ApiModelProperty(value="更新人")
     private Integer updatedBy;
 
     /**
      * 更新时间
      */
+    @ApiModelProperty(value="更新时间")
     private Date updatedTime;
 
+    private static final long serialVersionUID = 1L;
+
     public Integer getId() {
         return id;
     }
@@ -168,28 +191,20 @@ public class TenantInfo implements Serializable {
         this.dataSource = dataSource;
     }
 
-    public Integer getState() {
-        return state;
+    public Integer getPayState() {
+        return payState;
     }
 
-    public void setState(Integer state) {
-        this.state = state;
+    public void setPayState(Integer payState) {
+        this.payState = payState;
     }
 
-    public Date getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Date createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    public Date getUpdatedTime() {
-        return updatedTime;
+    public Integer getState() {
+        return state;
     }
 
-    public void setUpdatedTime(Date updatedTime) {
-        this.updatedTime = updatedTime;
+    public void setState(Integer state) {
+        this.state = state;
     }
 
     public Integer getCreatedBy() {
@@ -200,6 +215,14 @@ public class TenantInfo implements Serializable {
         this.createdBy = createdBy;
     }
 
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
     public Integer getUpdatedBy() {
         return updatedBy;
     }
@@ -208,9 +231,17 @@ public class TenantInfo implements Serializable {
         this.updatedBy = updatedBy;
     }
 
+    public Date getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Date updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
     @Override
     public String toString() {
         return ToStringBuilder.reflectionToString(this);
     }
-
 }
+

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/PlatformServeInfoVo.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.vo;
 
 import com.ym.mec.biz.dal.entity.PlatformServeDetail;
+import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -10,6 +11,7 @@ import java.util.List;
  * @author hgw
  * Created by 2021-12-03
  */
+@ApiModel(value = "平台服务信息")
 public class PlatformServeInfoVo implements Serializable {
 
     /**

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/PlatformServeModeVo.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.vo;
 
+import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -10,6 +11,7 @@ import java.util.List;
  * @author hgw
  * Created by 2021-12-06
  */
+@ApiModel(value = "平台服务付费模式信息")
 public class PlatformServeModeVo implements Serializable {
 
     /**

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/PlatformServePageVo.java

@@ -1,17 +1,24 @@
 package com.ym.mec.biz.dal.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
 import java.io.Serializable;
 
 /**
  * @author hgw
  * Created by 2021-12-03
  */
+@ApiModel(value = "平台服务分页查询信息")
 public class PlatformServePageVo implements Serializable {
 
+    @ApiModelProperty(value = "服务id")
     private Integer id ;
 
+    @ApiModelProperty(value = "服务名称")
     private String serveName;
 
+    @ApiModelProperty(value = "产品名称")
     private String productName;
 
     public Integer getId() {

+ 1 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/TenantInfoService.java

@@ -1,8 +1,5 @@
 package com.ym.mec.biz.service;
 
-import com.ym.mec.biz.dal.entity.TenantInfo;
-import com.ym.mec.common.service.BaseService;
-
-public interface TenantInfoService extends BaseService<Integer, TenantInfo> {
+public interface TenantInfoService {
 
 }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformProductServiceImpl.java

@@ -56,6 +56,7 @@ public class PlatformProductServiceImpl extends ServiceImpl<PlatformProductDao,
                 .map(SysUser::getId)
                 .orElse(null);
         PlatformProduct platformProduct = new PlatformProduct();
+        platformProduct.setId(obj.getId());
         platformProduct.setName(obj.getName());
         platformProduct.setMenuId(obj.getMenuId());
         platformProduct.setRemark(obj.getRemark());

+ 3 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -1,30 +1,20 @@
 package com.ym.mec.biz.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.biz.dal.dao.TenantInfoDao;
 import com.ym.mec.biz.dal.dto.TenantInfoDto;
 import com.ym.mec.biz.dal.entity.TenantInfo;
 import com.ym.mec.biz.service.TenantInfoService;
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service
-public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo> implements TenantInfoService {
-
-    @Autowired
-    private TenantInfoDao tenantInfoDao;
-
-    @Override
-    public BaseDAO<Integer, TenantInfo> getDAO() {
-        return tenantInfoDao;
-    }
+public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo> implements TenantInfoService {
 
     /**
      * 新增机构
      */
     public void addTenantInfo(TenantInfoDto tenantInfoDto) {
-        
+
     }
 
 }

+ 9 - 0
mec-biz/src/main/resources/config/mybatis/PlatformProductMapper.xml

@@ -30,6 +30,15 @@
         where id_ = #{id,jdbcType=INTEGER}
     </delete>
 
+    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.PlatformProduct" useGeneratedKeys="true">
+        insert into platform_product (name_, menu_id_, remark_,
+                                      deleted_, created_by_, created_time_,
+                                      updated_by_, updated_time_)
+        values (#{name,jdbcType=VARCHAR}, #{menuId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
+                #{deleted,jdbcType=INTEGER}, #{createdBy,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
+                #{updatedBy,jdbcType=INTEGER}, #{updatedTime,jdbcType=TIMESTAMP})
+    </insert>
+
     <insert id="insertSelective" parameterType="com.ym.mec.biz.dal.entity.PlatformProduct">
         insert into platform_product
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 167 - 73
mec-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -1,65 +1,173 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?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.ym.mec.biz.dal.dao.TenantInfoDao">
 
-	<resultMap type="com.ym.mec.biz.dal.entity.TenantInfo" id="TenantInfo">
-        <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="address_" jdbcType="VARCHAR" property="address" />
-        <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="domain_name_" jdbcType="VARCHAR" property="domainName" />
-        <result column="data_source_" jdbcType="VARCHAR" property="dataSource" />
-        <result column="state_" jdbcType="INTEGER" property="state" />
-        <result column="created_by_" jdbcType="INTEGER" property="createdBy" />
-        <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime" />
-        <result column="updated_by_" jdbcType="INTEGER" property="updatedBy" />
-        <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime" />
-	</resultMap>
+    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantInfo">
+        <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="address_" jdbcType="VARCHAR" property="address"/>
+        <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="domain_name_" jdbcType="VARCHAR" property="domainName"/>
+        <result column="data_source_" jdbcType="VARCHAR" property="dataSource"/>
+        <result column="pay_state_" jdbcType="INTEGER" property="payState"/>
+        <result column="state_" jdbcType="INTEGER" property="state"/>
+        <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
+        <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
+        <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
+        <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
+    </resultMap>
 
     <sql id="Base_Column_List">
-        id_, name_, contacts_, phone_, address_, email_, logo_, customer_service_phone, domain_name_,
-    data_source_, state_, created_by_, created_time_, updated_by_, updated_time_
+        id_
+        , name_, contacts_, phone_, address_, email_, logo_, customer_service_phone, domain_name_,
+    data_source_, pay_state_, state_, created_by_, created_time_, updated_by_, updated_time_
     </sql>
 
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="TenantInfo">
-		SELECT
-        <include refid="Base_Column_List" />
-		FROM
-		tenant_info WHERE id_ = #{id}
-	</select>
+    <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="findAll" resultMap="TenantInfo">
-		SELECT
-        <include refid="Base_Column_List" />
-		FROM tenant_info ORDER
-		BY id_
-	</select>
+    <select id="queryList" resultType="com.ym.mec.biz.dal.entity.TenantInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from tenant_info
+        <where>
+            <if test="state != null">
+                and state_ = #{state,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" parameterType="com.ym.mec.biz.dal.entity.TenantInfo">
+    <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_,
-        state_, created_by_, created_time_,
-        updated_by_, updated_time_)
+                                 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},
-        #{state,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP},
-        #{updatedBy,jdbcType=VARCHAR}, #{updatedTime,jdbcType=TIMESTAMP})
-	</insert>
+                #{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="update" parameterType="com.ym.mec.biz.dal.entity.TenantInfo">
-		UPDATE tenant_info
-		<set>
+    <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>
+
+    <update id="updateByKey" parameterType="com.ym.mec.biz.dal.entity.TenantInfo">
+        update tenant_info
+        <set>
             <if test="name != null">
                 name_ = #{name,jdbcType=VARCHAR},
             </if>
@@ -87,40 +195,26 @@
             <if test="dataSource != null">
                 data_source_ = #{dataSource,jdbcType=VARCHAR},
             </if>
+            <if test="payState != null">
+                pay_state_ = #{payState,jdbcType=INTEGER},
+            </if>
             <if test="state != null">
                 state_ = #{state,jdbcType=INTEGER},
             </if>
             <if test="createdBy != null">
-                created_by_ = #{createdBy,jdbcType=VARCHAR},
+                created_by_ = #{createdBy,jdbcType=INTEGER},
             </if>
             <if test="createdTime != null">
                 created_time_ = #{createdTime,jdbcType=TIMESTAMP},
             </if>
             <if test="updatedBy != null">
-                updated_by_ = #{updatedBy,jdbcType=VARCHAR},
+                updated_by_ = #{updatedBy,jdbcType=INTEGER},
             </if>
             <if test="updatedTime != null">
                 updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
             </if>
-		</set>
-		WHERE id_ = #{id}
-	</update>
-
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete">
-		DELETE FROM tenant_info WHERE id_ = #{id}
-	</delete>
-
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="TenantInfo" parameterType="map">
-		SELECT
-        <include refid="Base_Column_List" />
-		FROM tenant_info ORDER BY id_
-		<include refid="global.limit" />
-	</select>
+        </set>
+        where id_ = #{id,jdbcType=INTEGER}
+    </update>
 
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(id_) FROM tenant_info
-	</select>
-</mapper>
+</mapper>