Files
gxtyzx-java/modules/common/system/mapper/xml/VersionMapper.xml
T
2024-08-13 17:51:18 +08:00

72 lines
2.7 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.gxwebsoft.common.system.mapper.VersionMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM sys_version a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.versionName != null">
AND a.version_name LIKE CONCAT('%', #{param.versionName}, '%')
</if>
<if test="param.versionCode != null">
AND a.version_code = #{param.versionCode}
</if>
<if test="param.androidDownloadUrl != null">
AND a.android_download_url LIKE CONCAT('%', #{param.androidDownloadUrl}, '%')
</if>
<if test="param.iosDownloadUrl != null">
AND a.ios_download_url LIKE CONCAT('%', #{param.iosDownloadUrl}, '%')
</if>
<if test="param.updateInfo != null">
AND a.update_info LIKE CONCAT('%', #{param.updateInfo}, '%')
</if>
<if test="param.isHard != null">
AND a.is_hard = #{param.isHard}
</if>
<if test="param.isHot != null">
AND a.is_hot = #{param.isHot}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.Version">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.Version">
<include refid="selectSql"></include>
</select>
</mapper>