puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?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">
<mapper namespace="com.dsh.other.mapper.BannerMapper">
 
 
    <update id="changeState">
        update t_banner set
        state = #{state}
        <where>
            <if test="ids != null and ids.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>
        order by sort desc, insertTime desc
    </select>
 
    <insert id="createHistory">
        insert into t_usetime_history (createBy,pleasePic,passPic,insertTime,studentId)
 
            value(#{createHistoryDto.createBy},#{createHistoryDto.pleasePic},#{createHistoryDto.passPic},#{createHistoryDto.date},#{createHistoryDto.studentId})
 
    </insert>
    <select id="getHistory" resultType="com.dsh.other.entity.GetHistoryDto">
        SELECT hs.insertTime as date,hs.passPic,hs.pleasePic,us.`name` as createBy
        from t_usetime_history hs
                 LEFT JOIN sys_user us on hs.createBy = us.id
        where hs.studentId = #{studentId}
    </select>
    <select id="getFirst" resultType="java.lang.String">
            select content
            from t_img_config
            where position = 6
    </select>
    <select id="list1" resultType="com.dsh.other.model.BannerVo">
      select tb.id as id,tb.img as img, tb.page as page,tb.name as name,tb.type as type,
      tb.turnId as turnId  , tb.model as model, tb.typeId
      from t_banner tb
      where tb.position = #{position} and tb.state =1
    </select>
 
</mapper>