You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
4.6 KiB
XML

3 weeks ago
<?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.system.mapper.SysSoftwarePackageMapper">
<resultMap type="SysSoftwarePackage" id="SysSoftwarePackageResult">
<result property="id" column="id" />
<result property="fileName" column="file_name" />
<result property="filePath" column="file_path" />
<result property="version" column="version" />
<result property="fileSize" column="file_size" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysSoftwarePackageVo">
select id, file_name, file_path, version, file_size, create_by, create_time, update_by, update_time, remark from sys_software_package
</sql>
<select id="selectSysSoftwarePackageList" parameterType="SysSoftwarePackage" resultMap="SysSoftwarePackageResult">
<include refid="selectSysSoftwarePackageVo"/>
<where>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="version != null and version != ''"> and version = #{version}</if>
<if test="fileSize != null and fileSize != ''"> and file_size = #{fileSize}</if>
</where>
</select>
<select id="selectSysSoftwarePackageById" parameterType="Long" resultMap="SysSoftwarePackageResult">
<include refid="selectSysSoftwarePackageVo"/>
where id = #{id}
</select>
<select id="getMaxVersionApk" resultMap="SysSoftwarePackageResult">
SELECT * FROM sys_software_package ORDER BY version DESC LIMIT 1
</select>
<insert id="insertSysSoftwarePackage" parameterType="SysSoftwarePackage" useGeneratedKeys="true" keyProperty="id">
insert into sys_software_package
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileName != null">file_name,</if>
<if test="filePath != null">file_path,</if>
<if test="version != null">version,</if>
<if test="fileSize != null">file_size,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileName != null">#{fileName},</if>
<if test="filePath != null">#{filePath},</if>
<if test="version != null">#{version},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysSoftwarePackage" parameterType="SysSoftwarePackage">
update sys_software_package
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null">file_name = #{fileName},</if>
<if test="filePath != null">file_path = #{filePath},</if>
<if test="version != null">version = #{version},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysSoftwarePackageById" parameterType="Long">
delete from sys_software_package where id = #{id}
</delete>
<delete id="deleteSysSoftwarePackageByIds" parameterType="String">
delete from sys_software_package where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>