You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
4.2 KiB
91 lines
4.2 KiB
<?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.zc.business.mapper.DcFileDownloadMapper">
|
|
|
|
<resultMap type="DcFileDownload" id="DcFileDownloadResult">
|
|
<result property="id" column="id" />
|
|
<result property="fileName" column="file_name" />
|
|
<result property="fileAddress" column="file_address" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="size" column="size" />
|
|
<result property="extension" column="extension" />
|
|
<result property="number" column="number" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDcFileDownloadVo">
|
|
select id,number,size,extension, file_name, file_address, create_time, create_by, update_time, update_by from dc_file_download
|
|
</sql>
|
|
|
|
<select id="selectDcFileDownloadList" parameterType="DcFileDownload" resultMap="DcFileDownloadResult">
|
|
<include refid="selectDcFileDownloadVo"/>
|
|
<where>
|
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
|
<if test="fileAddress != null and fileAddress != ''"> and file_address = #{fileAddress}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectDcFileDownloadById" parameterType="Long" resultMap="DcFileDownloadResult">
|
|
<include refid="selectDcFileDownloadVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertDcFileDownload" parameterType="DcFileDownload" useGeneratedKeys="true" keyProperty="id">
|
|
insert into dc_file_download
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="fileName != null">file_name,</if>
|
|
<if test="fileAddress != null">file_address,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="size != null">size,</if>
|
|
<if test="extension != null">extension,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="fileName != null">#{fileName},</if>
|
|
<if test="fileAddress != null">#{fileAddress},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="size != null">#{size},</if>
|
|
<if test="extension != null">#{extension},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDcFileDownload" parameterType="DcFileDownload">
|
|
update dc_file_download
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="fileName != null">file_name = #{fileName},</if>
|
|
<if test="fileAddress != null">file_address = #{fileAddress},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="size != null">size = #{size},</if>
|
|
<if test="extension != null">extension = #{extension},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
<update id="downloadIncrease">
|
|
update dc_file_download set number=number+1 where id=#{id}
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDcFileDownloadById" parameterType="Long">
|
|
delete from dc_file_download where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteDcFileDownloadByIds" parameterType="String">
|
|
delete from dc_file_download where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|
|
|