<?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.SysClientAppMapper">
|
|
<resultMap type="SysClientApp" id="SysClientAppResult">
|
<result property="appId" column="app_id" />
|
<result property="clientName" column="client_name" />
|
<result property="appKey" column="app_key" />
|
<result property="securityKey" column="security_key" />
|
<result property="validStartTime" column="valid_start_time" />
|
<result property="validEndTime" column="valid_end_time" />
|
<result property="status" column="status" />
|
<result property="delFlag" column="del_flag" />
|
<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="selectSysClientAppVo">
|
select app_id, client_name, app_key, security_key, valid_start_time, valid_end_time, status, del_flag, create_by, create_time, update_by, update_time, remark from sys_client_app
|
</sql>
|
|
<select id="selectSysClientAppList" parameterType="SysClientApp" resultMap="SysClientAppResult">
|
<include refid="selectSysClientAppVo"/>
|
<where>
|
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
|
<if test="appKey != null and appKey != ''"> and app_key = #{appKey}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="validStartTime != null "> and valid_start_time >= #{validStartTime}</if>
|
<if test="validEndTime != null "> and valid_end_time <= #{validEndTime}</if>
|
</where>
|
</select>
|
|
<select id="selectSysClientAppByAppId" parameterType="Long" resultMap="SysClientAppResult">
|
<include refid="selectSysClientAppVo"/>
|
where app_id = #{appId}
|
</select>
|
|
<select id="selectSysClientAppByAppKey" parameterType="String" resultMap="SysClientAppResult">
|
<include refid="selectSysClientAppVo"/>
|
where app_key = #{appKey} and del_flag = '0'
|
</select>
|
|
<insert id="insertSysClientApp" parameterType="SysClientApp" useGeneratedKeys="true" keyProperty="appId">
|
insert into sys_client_app
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="clientName != null">client_name,</if>
|
<if test="appKey != null">app_key,</if>
|
<if test="securityKey != null">security_key,</if>
|
<if test="validStartTime != null">valid_start_time,</if>
|
<if test="validEndTime != null">valid_end_time,</if>
|
<if test="status != null">status,</if>
|
<if test="delFlag != null">del_flag,</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="clientName != null">#{clientName},</if>
|
<if test="appKey != null">#{appKey},</if>
|
<if test="securityKey != null">#{securityKey},</if>
|
<if test="validStartTime != null">#{validStartTime},</if>
|
<if test="validEndTime != null">#{validEndTime},</if>
|
<if test="status != null">#{status},</if>
|
<if test="delFlag != null">#{delFlag},</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="updateSysClientApp" parameterType="SysClientApp">
|
update sys_client_app
|
<set>
|
<if test="clientName != null and clientName != ''">client_name = #{clientName},</if>
|
<if test="appKey != null and appKey != ''">app_key = #{appKey},</if>
|
<if test="securityKey != null and securityKey != ''">security_key = #{securityKey},</if>
|
<if test="validStartTime != null">valid_start_time = #{validStartTime},</if>
|
<if test="validEndTime != null">valid_end_time = #{validEndTime},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
update_time = sysdate()
|
</set>
|
where app_id = #{appId}
|
</update>
|
|
<delete id="deleteSysClientAppByAppId" parameterType="Long">
|
delete from sys_client_app where app_id = #{appId}
|
</delete>
|
|
<delete id="deleteSysClientAppByAppIds" parameterType="Long">
|
delete from sys_client_app where app_id in
|
<foreach item="appId" collection="array" open="(" separator="," close=")">
|
#{appId}
|
</foreach>
|
</delete>
|
</mapper>
|