|
@@ -595,6 +595,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND #{endTime} >= cg.create_time
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
<select id="selectByBusinessId" resultType="com.zhongzheng.modules.grade.vo.ClassGradeVo">
|
|
|
SELECT
|
|
|
cg.*
|
|
@@ -605,6 +606,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="businessId != null and businessId !=''">
|
|
|
AND g.business_id = #{businessId}
|
|
|
</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getConsoleGradeUserAccountNum" parameterType="com.zhongzheng.modules.base.bo.ConsoleQueryBo" resultType="Integer">
|
|
|
+ SELECT
|
|
|
+ count(cgu.id)
|
|
|
+ FROM
|
|
|
+ class_grade_user cgu LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
|
|
|
+ LEFT JOIN goods g ON cgg.goods_id = g.goods_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ <if test="learnStatus != null">
|
|
|
+ AND cgu.learn_status = #{learnStatus}
|
|
|
+ </if>
|
|
|
+ <if test="finishStatus != null">
|
|
|
+ AND cgu.finish_status = #{finishStatus}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ AND cgu.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null">
|
|
|
+ AND #{endTime} >= cgu.create_time
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="getConsoleGradeAccountNum" parameterType="com.zhongzheng.modules.base.bo.ConsoleQueryBo" resultType="Integer">
|
|
|
+ SELECT
|
|
|
+ count(cg.grade_id)
|
|
|
+ FROM
|
|
|
+ class_grade cg LEFT JOIN class_grade_goods cgg ON cg.grade_id = cgg.grade_id
|
|
|
+ LEFT JOIN goods g ON cgg.goods_id = g.goods_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ <if test="interfaceAccountId != null and interfaceAccountId== 1">
|
|
|
+ AND cg.interface_account_id > 0
|
|
|
+ </if>
|
|
|
+ <if test="interfaceAccountId != null and interfaceAccountId== 0">
|
|
|
+ AND cg.interface_account_id is NULL
|
|
|
+ </if>
|
|
|
+ <if test="noInterfaceAccountId != null and noInterfaceAccountId== 1">
|
|
|
+ AND cg.no_interface_account_id > 0
|
|
|
+ </if>
|
|
|
+ <if test="noInterfaceAccountId != null and noInterfaceAccountId== 0">
|
|
|
+ AND cg.no_interface_account_id is NULL
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ AND cg.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null">
|
|
|
+ AND #{endTime} >= cg.create_time
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|