123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.zhyc.xps.common.mapper.SettingMapper">
- <resultMap id="BaseResultMap" type="com.zhyc.xps.common.entity.Setting">
- <result column="setting_id" property="settingId" jdbcType="BIGINT" />
- <result column="setting_title" property="settingTitle" jdbcType="VARCHAR"/>
- <result column="setting_key" property="settingKey" jdbcType="VARCHAR"/>
- <result column="setting_value" property="settingValue" jdbcType="VARCHAR"/>
- <result column="setting_desc" property="settingDesc" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- setting_id,
- setting_title,
- setting_key,
- setting_value,
- setting_desc
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM setting
- WHERE 1 = 1
- <if test="settingId != null">
- AND setting_id = #{settingId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--基于Key查询-->
- <select id="getByKey" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM setting
- WHERE 1 = 1
- <if test="settingKey != null and settingKey !=''">
- AND setting_key = #{settingKey ,jdbcType=VARCHAR}
- </if>
- </select>
- <!--查询列表-->
- <select id="getByList" resultMap="BaseResultMap" parameterType="java.util.Map">
- SELECT
- <include refid="Base_Column_List"/>
- FROM setting
- WHERE 1 = 1
- <if test="keywords != null and keywords != ''">
- and setting_title like "%"#{keywords}"%"
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" resultMap="BaseResultMap" parameterType="java.util.Map">
- SELECT
- <include refid="Base_Column_List"/>
- FROM setting
- WHERE 1 = 1
- <if test="keywords != null and keywords != ''">
- and setting_title like "%"#{keywords}"%"
- </if>
- </select>
- <!--新增-->
- <insert id="create" parameterType="com.zhyc.xps.common.entity.Setting">
- INSERT INTO setting
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="settingId != null">
- setting_id,
- </if>
- <if test="settingTitle != null and settingTitle !=''">
- setting_title,
- </if>
- <if test="settingKey != null and settingKey !=''">
- setting_key,
- </if>
- <if test="settingValue != null and settingValue !=''">
- setting_value,
- </if>
- <if test="settingDesc != null and settingDesc !=''">
- setting_desc,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="settingId != null and settingId !=''">
- #{settingId ,jdbcType=BIGINT},
- </if>
- <if test="settingTitle != null and settingTitle !=''">
- #{settingTitle ,jdbcType=VARCHAR},
- </if>
- <if test="settingKey != null and settingKey !=''">
- #{settingKey ,jdbcType=VARCHAR},
- </if>
- <if test="settingValue != null and settingValue !=''">
- #{settingValue ,jdbcType=VARCHAR},
- </if>
- <if test="settingDesc != null and settingDesc !=''">
- #{settingDesc ,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.common.entity.Setting">
- UPDATE setting
- <trim suffixOverrides=",">
- <set>
- <if test="settingTitle != null and settingTitle != ''">
- setting_title = #{settingTitle, jdbcType=VARCHAR},
- </if>
- <if test="settingKey != null and settingKey !=''">
- setting_key = #{settingKey ,jdbcType=VARCHAR},
- </if>
- <if test="settingValue != null and settingValue !=''">
- setting_value = #{settingValue ,jdbcType=VARCHAR},
- </if>
- <if test="settingDesc != null and settingDesc != ''">
- setting_desc = #{settingDesc, jdbcType=VARCHAR},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="settingId != null">
- AND setting_id = #{settingId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- delete FROM setting
- WHERE 1 = 1
- <if test="settingId != null">
- AND setting_id = #{settingId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|