<?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>
|