Files
zhwl/zhwl-wcsc/target/classes/mapper/wcsc/ZdyWcscSearchHistoryMapper.xml
2025-07-01 17:54:58 +08:00

89 lines
3.1 KiB
XML

<?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.zhwl.wcsc.mapper.ZdyWcscSearchHistoryMapper">
<resultMap type="ZdyWcscSearchHistory" id="ZdyWcscSearchHistoryResult">
<result property="id" column="id"/>
<result property="content" column="content"/>
<result property="searchTime" column="search_time"/>
<result property="createBy" column="create_by"/>
</resultMap>
<sql id="selectZdyWcscSearchHistoryVo">
select id, content, search_time, create_by
from zdy_wcsc_search_history
</sql>
<select id="selectZdyWcscSearchHistoryList" parameterType="ZdyWcscSearchHistory"
resultMap="ZdyWcscSearchHistoryResult">
<include refid="selectZdyWcscSearchHistoryVo"/>
<where>
<if test="content != null and content != ''">
and content = #{content}
</if>
<if test="searchTime != null ">
and search_time = #{searchTime}
</if>
<if test="createBy != null ">
and create_by = #{createBy}
</if>
</where>
order by search_time desc
</select>
<select id="selectZdyWcscSearchHistoryById" parameterType="Long"
resultMap="ZdyWcscSearchHistoryResult">
<include refid="selectZdyWcscSearchHistoryVo"/>
where id = #{id}
</select>
<insert id="insertZdyWcscSearchHistory" parameterType="ZdyWcscSearchHistory" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_wcsc_search_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="content != null">content,
</if>
<if test="searchTime != null">search_time,
</if>
<if test="createBy != null">create_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="content != null">#{content},
</if>
<if test="searchTime != null">#{searchTime},
</if>
<if test="createBy != null">#{createBy},
</if>
</trim>
</insert>
<update id="updateZdyWcscSearchHistory" parameterType="ZdyWcscSearchHistory">
update zdy_wcsc_search_history
<trim prefix="SET" suffixOverrides=",">
<if test="content != null">content =
#{content},
</if>
<if test="searchTime != null">search_time =
#{searchTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyWcscSearchHistoryById" parameterType="Long">
delete from zdy_wcsc_search_history where id = #{id}
</delete>
<delete id="deleteZdyWcscSearchHistoryByIds" parameterType="String">
delete from zdy_wcsc_search_history where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>