puzhibing
2023-08-04 624c9eec90d59297800f03276f8518daa1bd9f94
cloud-server-course/src/main/resources/mapper/TCoursePackageMapper.xml
@@ -52,4 +52,44 @@
          and ts.`state` = 1
    </select>
    <select id="queryCoursePackageLists" resultType="map">
        select
        a.id,
        CONCAT(a.province, a.city) as city,
        a.storeId,
        b.`name` as coursePackageType,
        a.`name`,
        a.maxSubscribeNumber,
        CONCAT('购买后', a.validDays, '天内有效') as validDays,
        a.sort,
        a.`status`,
        a.state
        from t_course_package a
        left join t_course_package_type b on (a.coursePackageTypeId = b.id)
        where a.state != 3
        <if test="null != item.provinceCode and '' != item.provinceCode">
            and a.provinceCode = #{item.provinceCode}
        </if>
        <if test="null != item.cityCode and '' != item.cityCode">
            and a.cityCode = #{item.cityCode}
        </if>
        <if test="null != item.coursePackageTypeId">
            and a.coursePackageTypeId = #{item.coursePackageTypeId}
        </if>
        <if test="null != item.storeId">
            and a.storeId = #{item.storeId}
        </if>
        <if test="null != item.name and '' != item.name">
            and a.name line CONCAT('%', #{item.name}, '%')
        </if>
        <if test="null != item.status">
            and a.status = #{item.status}
        </if>
        <if test="null != item.state">
            and a.state = #{item.state}
        </if>
        order by a.insertTime desc
    </select>
</mapper>