|
@@ -1,42 +1,43 @@
|
|
|
<?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">
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.diagbot.mapper.OpenedProductsMapper">
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.OpenedProducts">
|
|
|
- <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" />
|
|
|
- <result column="access_type" property="accessType" />
|
|
|
- <result column="charge_type" property="chargeType" />
|
|
|
+ <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"/>
|
|
|
+ <result column="access_type" property="accessType"/>
|
|
|
+ <result column="charge_type" property="chargeType"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultWrapper" type="com.diagbot.entity.wrapper.OpendProductWrapper">
|
|
|
- <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" />
|
|
|
- <result column="access_type" property="accessType" />
|
|
|
- <result column="charge_type" property="chargeType" />
|
|
|
- <result column="order_time" property="orderTime" />
|
|
|
+ <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"/>
|
|
|
+ <result column="access_type" property="accessType"/>
|
|
|
+ <result column="charge_type" property="chargeType"/>
|
|
|
+ <result column="order_time" property="orderTime"/>
|
|
|
</resultMap>
|
|
|
<select id="selectOpendInfoByUserId" resultMap="BaseResultMap" parameterType="java.util.List">
|
|
|
SELECT opend.* FROM diag_opened_products opend WHERE user_id = #{userId}
|
|
@@ -45,10 +46,10 @@
|
|
|
<select id="selectOpenedProducts" resultMap="BaseResultMap" parameterType="java.util.Map">
|
|
|
SELECT t.* FROM diag_opened_products t WHERE t.is_deleted='N'
|
|
|
<if test="userId != null and userId != ''">
|
|
|
- and t.user_id = #{userId}
|
|
|
+ and t.user_id = #{userId}
|
|
|
</if>
|
|
|
<if test="productId != null and productId != ''">
|
|
|
- and t.product_id=#{productId}
|
|
|
+ and t.product_id=#{productId}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -60,7 +61,8 @@
|
|
|
and st.app_key_id = #{appkey} and st.app_key_secret = #{secret}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getConsoleOpened" parameterType="long" resultType="com.diagbot.dto.GetConsoleOpenedDTO">
|
|
|
+ <select id="getConsoleOpened" parameterType="long"
|
|
|
+ resultType="com.diagbot.dto.GetConsoleOpenedDTO">
|
|
|
SELECT
|
|
|
a.id as openId,
|
|
|
b.id as productId,
|
|
@@ -71,7 +73,7 @@
|
|
|
from diag_opened_products a join diag_lantone_product b on a.product_id=b.id
|
|
|
where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId};
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="getConsoleOpenedCount" parameterType="long" resultType="int">
|
|
|
SELECT
|
|
|
count(1)
|
|
@@ -79,7 +81,8 @@
|
|
|
where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId};
|
|
|
</select>
|
|
|
|
|
|
- <select id="getConsoleOnTrial" parameterType="long" resultType="com.diagbot.dto.GetConsoleOnTrialDTO">
|
|
|
+ <select id="getConsoleOnTrial" parameterType="long"
|
|
|
+ resultType="com.diagbot.dto.GetConsoleOnTrialDTO">
|
|
|
SELECT
|
|
|
a.id as id,
|
|
|
a.name as name,
|
|
@@ -97,7 +100,7 @@
|
|
|
and c.user_id=#{userId}
|
|
|
and a.id not in (SELECT product_id FROM diag_opened_products where user_id=#{userId})
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="getConsoleOnTrialCount" parameterType="long" resultType="int">
|
|
|
SELECT
|
|
|
count(1)
|
|
@@ -110,78 +113,80 @@
|
|
|
and c.user_id=#{userId}
|
|
|
and a.id not in (SELECT product_id FROM diag_opened_products where user_id=#{userId})
|
|
|
</select>
|
|
|
-<select id="getInformationAvailableByUserId" parameterType="com.diagbot.entity.OpenedProducts" resultType = "com.diagbot.dto.UserAndProdutDTO">
|
|
|
+ <select id="getInformationAvailableByUserId" parameterType="com.diagbot.entity.OpenedProducts"
|
|
|
+ resultType="com.diagbot.dto.UserAndProdutDTO">
|
|
|
|
|
|
- SELECT
|
|
|
- a.id as Id,
|
|
|
- a.product_id as productId,
|
|
|
- a.user_id as userId,
|
|
|
- a.start_time as startTime,
|
|
|
- a.end_time as endTime,
|
|
|
- a.service_status as serviceStatus,
|
|
|
- a.access_type as accessType,
|
|
|
- a.charge_type as chargeType,
|
|
|
- b.name as productName
|
|
|
- FROM diag_opened_products a JOIN diag_lantone_product b
|
|
|
- ON a.product_id=b.id
|
|
|
- WHERE
|
|
|
- a.is_deleted = "N"
|
|
|
- <if test="userId !=null">
|
|
|
- AND a.user_id = #{userId}
|
|
|
- </if>
|
|
|
-</select>
|
|
|
+ SELECT
|
|
|
+ a.id as Id,
|
|
|
+ a.product_id as productId,
|
|
|
+ a.user_id as userId,
|
|
|
+ a.start_time as startTime,
|
|
|
+ a.end_time as endTime,
|
|
|
+ a.service_status as serviceStatus,
|
|
|
+ a.access_type as accessType,
|
|
|
+ a.charge_type as chargeType,
|
|
|
+ b.name as productName
|
|
|
+ FROM diag_opened_products a JOIN diag_lantone_product b
|
|
|
+ ON a.product_id=b.id
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = "N"
|
|
|
+ <if test="userId !=null">
|
|
|
+ AND a.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
-<update id="startAndendByuserId" parameterType = "com.diagbot.entity.OpenedProducts">
|
|
|
- UPDATE diag_opened_products a
|
|
|
- <trim prefix="set" suffixOverrides=",">
|
|
|
- <if test="gmtModified !=null">a.gmt_modified=#{gmtModified},</if>
|
|
|
- <if test="modifier != null">a.modifier=#{modifier},</if>
|
|
|
- <if test="serviceStatus != null">a.service_status =#{serviceStatus}</if>
|
|
|
- </trim>
|
|
|
- WHERE
|
|
|
- a.user_id = #{userId}
|
|
|
- AND a.product_id = #{productId}
|
|
|
-</update>
|
|
|
+ <update id="startAndendByuserId" parameterType="com.diagbot.entity.OpenedProducts">
|
|
|
+ UPDATE diag_opened_products a
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="gmtModified !=null">a.gmt_modified=#{gmtModified},</if>
|
|
|
+ <if test="modifier != null">a.modifier=#{modifier},</if>
|
|
|
+ <if test="serviceStatus != null">a.service_status =#{serviceStatus}</if>
|
|
|
+ </trim>
|
|
|
+ WHERE
|
|
|
+ a.user_id = #{userId}
|
|
|
+ AND a.product_id = #{productId}
|
|
|
+ </update>
|
|
|
|
|
|
-<update id="delInformationAvailable" parameterType = "com.diagbot.entity.OpenedProducts" >
|
|
|
- UPDATE diag_opened_products a
|
|
|
- <trim prefix="set" suffixOverrides=",">
|
|
|
- a.is_deleted = "Y",
|
|
|
- <if test="gmtModified !=null">a.gmt_modified=#{gmtModified},</if>
|
|
|
- <if test="modifier != null">a.modifier=#{modifier}</if>
|
|
|
- </trim>
|
|
|
- WHERE
|
|
|
- a.user_id = #{userId}
|
|
|
- AND a.product_id = #{productId}
|
|
|
-</update>
|
|
|
+ <update id="delInformationAvailable" parameterType="com.diagbot.entity.OpenedProducts">
|
|
|
+ UPDATE diag_opened_products a
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ a.is_deleted = "Y",
|
|
|
+ <if test="gmtModified !=null">a.gmt_modified=#{gmtModified},</if>
|
|
|
+ <if test="modifier != null">a.modifier=#{modifier}</if>
|
|
|
+ </trim>
|
|
|
+ WHERE
|
|
|
+ a.user_id = #{userId}
|
|
|
+ AND a.product_id = #{productId}
|
|
|
+ </update>
|
|
|
|
|
|
-<update id="modifyOpeningTime" parameterType="com.diagbot.entity.OpenedProducts">
|
|
|
- UPDATE diag_opened_products a
|
|
|
- <trim prefix="set" suffixOverrides=",">
|
|
|
- <if test="gmtModified !=null">a.gmt_modified=#{gmtModified},</if>
|
|
|
- <if test="modifier != null">a.modifier=#{modifier}</if>
|
|
|
- <if test="startTime != null">a.start_time = #{startTime},</if>
|
|
|
- <if test="endTime != null">a.end_time = #{endTime} </if>
|
|
|
- </trim>
|
|
|
- WHERE
|
|
|
- a.user_id = #{userId}
|
|
|
- AND a.product_id = #{productId}
|
|
|
-</update>
|
|
|
+ <update id="modifyOpeningTime" parameterType="com.diagbot.entity.OpenedProducts">
|
|
|
+ UPDATE diag_opened_products a
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="gmtModified !=null">a.gmt_modified=#{gmtModified},</if>
|
|
|
+ <if test="modifier != null">a.modifier=#{modifier}</if>
|
|
|
+ <if test="startTime != null">a.start_time = #{startTime},</if>
|
|
|
+ <if test="endTime != null">a.end_time = #{endTime}</if>
|
|
|
+ </trim>
|
|
|
+ WHERE
|
|
|
+ a.user_id = #{userId}
|
|
|
+ AND a.product_id = #{productId}
|
|
|
+ </update>
|
|
|
|
|
|
- <select id="getByProductId" parameterType="com.diagbot.entity.OpenedProductsIndex" resultMap="BaseResultWrapper">
|
|
|
- SELECT a.*,b.time order_time from diag_opened_products a
|
|
|
- LEFT JOIN diag_product_order b ON a.order_id =b.id
|
|
|
- WHERE product_id =#{productId} AND a.is_deleted='N'
|
|
|
+ <select id="getByProductId" parameterType="com.diagbot.entity.OpenedProductsIndex"
|
|
|
+ resultMap="BaseResultWrapper">
|
|
|
+ SELECT a.*,b.time order_time from diag_opened_products a
|
|
|
+ LEFT JOIN diag_product_order b ON a.order_id =b.id
|
|
|
+ WHERE product_id =#{productId} AND a.is_deleted='N'
|
|
|
<if test="serviceStatus != null and serviceStatus != ''">
|
|
|
and t.service_status=#{serviceStatus}
|
|
|
</if>
|
|
|
LIMIT #{index},#{size}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getOpendById" resultMap="BaseResultMap" parameterType="java.util.List">
|
|
|
- SELECT * FROM `diag_opened_products` a where a.service_status ='1'
|
|
|
- <if test="productId != null and productId != ''">
|
|
|
- and a.product_id =#{productId}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
+ <select id="getOpendById" resultMap="BaseResultMap" parameterType="java.util.List">
|
|
|
+ SELECT * FROM `diag_opened_products` a where a.service_status ='1'
|
|
|
+ <if test="productId != null and productId != ''">
|
|
|
+ and a.product_id =#{productId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|