liujie
2023-09-23 852681bc9257e9eaae64d027a9bc6d88f93f35b4
cloud-server-other/src/main/resources/mapper/BannerMapper.xml
@@ -2,6 +2,35 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsh.other.mapper.BannerMapper">
    <update id="changeState">
        update t_banner set
        state = #{state}
        <where>
        <if test="ids != null and questionIds.size()>0">
        AND t_banner.id IN
        <foreach collection="ids" separator="," item="id" open="(" close=")">
            #{id}
        </foreach>
    </if>
        </where>
    </update>
    <select id="listAll" resultType="com.dsh.other.entity.Banner">
        select * from t_banner
        <where>
            <if test="query.advertisementName!=null and query.advertisementName!= ''">
                and t_banner.name like concat('%',#{query.advertisementName},'%')
            </if>
            <if test="query.page!=null and query.page!= ''">
                and t_banner.jumpPage like concat('%',#{query.page},'%')
            </if>
            <if test="query.state!=null and query.state!= ''">
                and t_banner.state = #{query.state}
            </if>
        </where>
    </select>
    <insert id="createHistory">
        insert into t_usetime_history (createBy,pleasePic,passPic,insertTime,studentId)