Browse Source

王宇:产品管理基础类

bijl 6 years ago
parent
commit
16ac40ced4

+ 240 - 0
diagbotman-service/src/main/java/com/diagbot/entity/DiagLantoneProduct.java

@@ -0,0 +1,240 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 朗通产品表
+ * </p>
+ *
+ * @author wangyu
+ * @since 2018-09-18
+ */
+@TableName("diag_lantone_product")
+public class DiagLantoneProduct implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 产品id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 是否删除 N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 产品名称
+     */
+    private String name;
+
+    /**
+     * 产品介绍
+     */
+    private String decription;
+
+    /**
+     * 计费方式
+     */
+    private String chargeType;
+
+    /**
+     * 产品路径
+     */
+    private String url;
+
+    /**
+     * 机构开通数量
+     */
+    private Integer openNum;
+
+    /**
+     * 停用状态
+     */
+    private Integer serviceStatus;
+
+    /**
+     * 试用状态
+     */
+    private Integer trialStatus;
+
+    /**
+     * 试用地址
+     */
+    private String trialUrl;
+
+    /**
+     * 接入方式(1:嵌入式,2:接口方式,3:online)
+     */
+    private String accessType;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDecription() {
+        return decription;
+    }
+
+    public void setDecription(String decription) {
+        this.decription = decription;
+    }
+
+    public String getChargeType() {
+        return chargeType;
+    }
+
+    public void setChargeType(String chargeType) {
+        this.chargeType = chargeType;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Integer getOpenNum() {
+        return openNum;
+    }
+
+    public void setOpenNum(Integer openNum) {
+        this.openNum = openNum;
+    }
+
+    public Integer getServiceStatus() {
+        return serviceStatus;
+    }
+
+    public void setServiceStatus(Integer serviceStatus) {
+        this.serviceStatus = serviceStatus;
+    }
+
+    public Integer getTrialStatus() {
+        return trialStatus;
+    }
+
+    public void setTrialStatus(Integer trialStatus) {
+        this.trialStatus = trialStatus;
+    }
+
+    public String getTrialUrl() {
+        return trialUrl;
+    }
+
+    public void setTrialUrl(String trialUrl) {
+        this.trialUrl = trialUrl;
+    }
+
+    public String getAccessType() {
+        return accessType;
+    }
+
+    public void setAccessType(String accessType) {
+        this.accessType = accessType;
+    }
+
+    @Override
+    public String toString() {
+        return "LantoneProduct{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", name=" + name +
+                ", decription=" + decription +
+                ", chargeType=" + chargeType +
+                ", url=" + url +
+                ", openNum=" + openNum +
+                ", serviceStatus=" + serviceStatus +
+                ", trialStatus=" + trialStatus +
+                ", trialUrl=" + trialUrl +
+                ", accessType=" + accessType +
+                "}";
+    }
+}

+ 195 - 0
diagbotman-service/src/main/java/com/diagbot/entity/DiagOpenedProducts.java

@@ -0,0 +1,195 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 已开通产品实体类
+ * @Author: wangyu
+ * @Date: 15:39 2018/9/17
+ */
+@TableName("diag_opened_products")
+public class DiagOpenedProducts implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 已开通产品id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 产品id
+     */
+    private Integer productId;
+
+    /**
+     * 用户id
+     */
+    private Integer userId;
+
+    /**
+     * 开通日期
+     */
+    private Date startTime;
+
+    /**
+     * 结束日期
+     */
+    private Date endTime;
+
+    /**
+     * 停用状态
+     */
+    private Integer serviceStatus;
+
+    /**
+     * 订单id
+     */
+    private Integer orderId;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getServiceStatus() {
+        return serviceStatus;
+    }
+
+    public void setServiceStatus(Integer serviceStatus) {
+        this.serviceStatus = serviceStatus;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    @Override
+    public String toString() {
+        return "OpenedProducts{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", productId=" + productId +
+                ", userId=" + userId +
+                ", startTime=" + startTime +
+                ", endTime=" + endTime +
+                ", serviceStatus=" + serviceStatus +
+                ", orderId=" + orderId +
+                "}";
+    }
+}

+ 42 - 0
diagbotman-service/src/main/resources/mapper/DiagLantoneProductMapper.xml

@@ -0,0 +1,42 @@
+<?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.diagbot.mapper.DiagLantoneProductMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DiagLantoneProduct">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="name" property="name" />
+        <result column="decription" property="decription" />
+        <result column="charge_type" property="chargeType" />
+        <result column="url" property="url" />
+        <result column="open_num" property="openNum" />
+        <result column="service_status" property="serviceStatus" />
+        <result column="trial_status" property="trialStatus" />
+        <result column="trial_url" property="trialUrl" />
+        <result column="access_type" property="accessType" />
+    </resultMap>
+    <!--根据用户id查询用户是否有开通产品-->
+    <select id="productLine" resultMap="BaseResultMap">
+        SELECT * from diag_lantone_product p WHERE p.is_deleted ='N'
+        <if test="userId != null">
+            and id NOT IN (SELECT product_id FROM diag_opened_products WHERE user_id =#{userId})
+        </if>
+    </select>
+
+    <!--根据产品名称分页查询-->
+    <select id="selectProduct" resultMap="BaseResultMap">
+        SELECT * from diag_lantone_product p WHERE p.is_deleted ='N' and service_status NOT IN('0')
+        <if test="name != null and name != ''">
+            AND p.name LIKE concat ('%',#{name},'%')
+        </if>
+    </select>
+
+    <update id="updateProduct" parameterType="com.diagbot.entity.DiagLantoneProduct">
+        UPDATE `diag_lantone_product` SET `name`=#{name}, `gmtModified`=#{gmtModified}, `decription`=#{decription}, `url`=#{url},chargeType=#{chargeType} WHERE (`id`=#{id})
+    </update>
+</mapper>

+ 23 - 0
diagbotman-service/src/main/resources/mapper/DiagOpenedProductsMapper.xml

@@ -0,0 +1,23 @@
+<?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.diagbot.mapper.DiagOpenedProductsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DiagOpenedProducts">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="product_id" property="productId" />
+        <result column="user_id" property="userId" />
+        <result column="start_time" property="startTime" />
+        <result column="end_time" property="endTime" />
+        <result column="service_status" property="serviceStatus" />
+        <result column="order_id" property="orderId" />
+    </resultMap>
+    <select id="selectOpendInfoByUserId" resultMap="BaseResultMap" parameterType="java.util.List">
+        SELECT opend.* FROM diag_opened_products opend WHERE user_id = #{userId}
+    </select>
+</mapper>