|
@@ -0,0 +1,128 @@
|
|
|
+<?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.ruoyi.rc.mapper.TCommonfileMapper">
|
|
|
+
|
|
|
+ <resultMap type="TCommonfile" id="TCommonfileResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="pId" column="p_id" />
|
|
|
+ <result property="fileName" column="file_name" />
|
|
|
+ <result property="fileUrl" column="file_url" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createrCode" column="creater_code" />
|
|
|
+ <result property="createdate" column="createdate" />
|
|
|
+ <result property="updaterCode" column="updater_code" />
|
|
|
+ <result property="updatedate" column="updatedate" />
|
|
|
+ <result property="remarks" column="remarks" />
|
|
|
+ <result property="pType" column="p_type" />
|
|
|
+ <result property="fileSize" column="file_size" />
|
|
|
+ <result property="pValue" column="p_value" />
|
|
|
+ <result property="pDate" column="p_date" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTCommonfileVo">
|
|
|
+ select id, p_id, file_name, file_url, del_flag, creater_code, createdate, updater_code, updatedate, remarks, p_type, file_size, p_value, p_date from t_commonfile
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectAllFileList" parameterType="TCommonfile" resultMap="TCommonfileResult">
|
|
|
+ select d.file_size , d.p_value, d.p_date ,u.nick_name, d.id, d.p_id, d.file_name, d.file_url, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.p_type from t_commonfile d
|
|
|
+ LEFT JOIN SYS_USER u on d.CREATER_CODE = u.USER_ID
|
|
|
+ <where>
|
|
|
+ <if test="pId != null "> and p_id = #{pId}</if>
|
|
|
+ <if test="pType != null "> and p_type = #{pType}</if>
|
|
|
+ <if test="pValue != null and pValue != ''"> and p_value = #{pValue}</if>
|
|
|
+ <if test="pDate != null "> and p_date = #{pDate}</if>
|
|
|
+ and d.del_flag = 0
|
|
|
+ </where>
|
|
|
+ order by p_date desc , d.createdate desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTCommonfileList" parameterType="TCommonfile" resultMap="TCommonfileResult">
|
|
|
+ <include refid="selectTCommonfileVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="pId != null "> and p_id = #{pId}</if>
|
|
|
+ <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
|
|
+ <if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
|
|
+ <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
|
|
|
+ <if test="createdate != null "> and createdate = #{createdate}</if>
|
|
|
+ <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
|
|
|
+ <if test="updatedate != null "> and updatedate = #{updatedate}</if>
|
|
|
+ <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
|
|
+ <if test="pType != null and pType != ''"> and p_type = #{pType}</if>
|
|
|
+ <if test="fileSize != null and fileSize != ''"> and file_size = #{fileSize}</if>
|
|
|
+ <if test="pValue != null and pValue != ''"> and p_value = #{pValue}</if>
|
|
|
+ <if test="pDate != null "> and p_date = #{pDate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTCommonfileById" parameterType="Long" resultMap="TCommonfileResult">
|
|
|
+ <include refid="selectTCommonfileVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTCommonfile" parameterType="TCommonfile" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into t_commonfile
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="pId != null">p_id,</if>
|
|
|
+ <if test="fileName != null">file_name,</if>
|
|
|
+ <if test="fileUrl != null">file_url,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createrCode != null">creater_code,</if>
|
|
|
+ <if test="createdate != null">createdate,</if>
|
|
|
+ <if test="updaterCode != null">updater_code,</if>
|
|
|
+ <if test="updatedate != null">updatedate,</if>
|
|
|
+ <if test="remarks != null">remarks,</if>
|
|
|
+ <if test="pType != null">p_type,</if>
|
|
|
+ <if test="fileSize != null">file_size,</if>
|
|
|
+ <if test="pValue != null">p_value,</if>
|
|
|
+ <if test="pDate != null">p_date,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="pId != null">#{pId},</if>
|
|
|
+ <if test="fileName != null">#{fileName},</if>
|
|
|
+ <if test="fileUrl != null">#{fileUrl},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createrCode != null">#{createrCode},</if>
|
|
|
+ <if test="createdate != null">#{createdate},</if>
|
|
|
+ <if test="updaterCode != null">#{updaterCode},</if>
|
|
|
+ <if test="updatedate != null">#{updatedate},</if>
|
|
|
+ <if test="remarks != null">#{remarks},</if>
|
|
|
+ <if test="pType != null">#{pType},</if>
|
|
|
+ <if test="fileSize != null">#{fileSize},</if>
|
|
|
+ <if test="pValue != null">#{pValue},</if>
|
|
|
+ <if test="pDate != null">#{pDate},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTCommonfile" parameterType="TCommonfile">
|
|
|
+ update t_commonfile
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="pId != null">p_id = #{pId},</if>
|
|
|
+ <if test="fileName != null">file_name = #{fileName},</if>
|
|
|
+ <if test="fileUrl != null">file_url = #{fileUrl},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createrCode != null">creater_code = #{createrCode},</if>
|
|
|
+ <if test="createdate != null">createdate = #{createdate},</if>
|
|
|
+ <if test="updaterCode != null">updater_code = #{updaterCode},</if>
|
|
|
+ <if test="updatedate != null">updatedate = #{updatedate},</if>
|
|
|
+ <if test="remarks != null">remarks = #{remarks},</if>
|
|
|
+ <if test="pType != null">p_type = #{pType},</if>
|
|
|
+ <if test="fileSize != null">file_size = #{fileSize},</if>
|
|
|
+ <if test="pValue != null">p_value = #{pValue},</if>
|
|
|
+ <if test="pDate != null">p_date = #{pDate},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTCommonfileById" parameterType="Long">
|
|
|
+ delete from t_commonfile where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTCommonfileByIds" parameterType="String">
|
|
|
+ delete from t_commonfile where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|