|
@@ -91,6 +91,60 @@
|
|
|
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 = "long" 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"
|
|
|
+ AND a.user_id = #{userId}
|
|
|
+</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="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>
|
|
|
|
|
|
</mapper>
|