123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?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.sys.mapper.OcAccessMapper">
- <resultMap id="AccessDtoResultMap" type="com.zhyc.xps.sys.dto.OcAccessDto">
- <result column="access_id" property="accessId" jdbcType="BIGINT" />
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="oc_name" property="ocName" jdbcType="VARCHAR"/>
- <result column="access_url" property="accessUrl" jdbcType="VARCHAR"/>
- <result column="access_app_id" property="accessAppId" jdbcType="VARCHAR"/>
- <result column="access_app_key" property="accessAppKey" jdbcType="VARCHAR"/>
- <result column="access_app_secret" property="accessAppSecret" jdbcType="VARCHAR"/>
- <result column="access_token" property="accessToken" jdbcType="VARCHAR"/>
- <result column="status" property="status" jdbcType="BIGINT" />
- <result column="remark" property="remark" jdbcType="VARCHAR"/>
- <result column="access_time" property="accessTime" jdbcType="DATE" />
- </resultMap>
- <sql id="AccessDto_Cols">
- A.access_id,
- A.oc_id,
- B.oc_name,
- A.access_url,
- A.access_app_id,
- A.access_app_key,
- A.access_app_secret,
- A.access_token,
- A.status,
- A.remark,
- A.access_time
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="AccessDtoResultMap">
- SELECT
- <include refid="AccessDto_Cols"/>
- FROM oc_access AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- WHERE A.deleted_flag = 0
- <if test="accessId != null">
- AND access_id = #{accessId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="AccessDtoResultMap">
- SELECT
- <include refid="AccessDto_Cols"/>
- FROM oc_access AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- WHERE A.deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND B.oc_name like "%"#{keywords}"%"
- </if>
- ORDER BY A.access_time DESC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="AccessDtoResultMap">
- SELECT
- <include refid="AccessDto_Cols"/>
- FROM oc_access AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- WHERE A.deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND B.oc_name like "%"#{keywords}"%"
- </if>
- ORDER BY A.access_time DESC
- </select>
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.OcAccess">
- INSERT INTO oc_access
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="accessId != null">
- access_id,
- </if>
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="accessUrl != null and accessUrl != ''">
- access_url,
- </if>
- <if test="accessAppId != null and accessAppId !=''">
- access_app_id,
- </if>
- <if test="accessAppKey != null and accessAppKey !=''">
- access_app_key,
- </if>
- <if test="accessAppSecret != null and accessAppSecret !=''">
- access_app_secret,
- </if>
- <if test="accessToken != null and accessToken !=''">
- access_token,
- </if>
- <if test="status != null and status !=''">
- status,
- </if>
- <if test="remark != null and remark !=''">
- remark,
- </if>
- <if test="accessTime != null">
- access_time,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="accessId != null">
- #{accessId ,jdbcType=BIGINT},
- </if>
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="accessUrl != null and accessUrl != ''">
- #{accessUrl ,jdbcType=VARCHAR},
- </if>
- <if test="accessAppId != null and accessAppId !=''">
- #{accessAppId ,jdbcType=VARCHAR},
- </if>
- <if test="accessAppKey != null and accessAppKey !=''">
- #{accessAppKey ,jdbcType=VARCHAR},
- </if>
- <if test="accessAppSecret != null and accessAppSecret !=''">
- #{accessAppSecret ,jdbcType=VARCHAR},
- </if>
- <if test="accessToken != null and accessToken !=''">
- #{accessToken ,jdbcType=VARCHAR},
- </if>
- <if test="status != null and status !=''">
- #{status ,jdbcType=BIGINT},
- </if>
- <if test="remark != null and remark !=''">
- #{remark ,jdbcType=VARCHAR},
- </if>
- <if test="accessTime != null">
- #{accessTime ,jdbcType=DATE},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.OcAccess">
- UPDATE oc_access
- <trim suffixOverrides=",">
- <set>
- <if test="accessUrl != null and accessUrl != ''">
- access_url = #{accessUrl ,jdbcType=VARCHAR},
- </if>
- <if test="accessAppId != null and accessAppId !=''">
- access_app_id = #{accessAppId ,jdbcType=VARCHAR},
- </if>
- <if test="accessAppKey != null and accessAppKey !=''">
- access_app_key = #{accessAppKey ,jdbcType=VARCHAR},
- </if>
- <if test="accessAppSecret != null and accessAppSecret !=''">
- access_app_secret = #{accessAppSecret ,jdbcType=VARCHAR},
- </if>
- <if test="accessToken != null and accessToken !=''">
- access_token = #{accessToken ,jdbcType=VARCHAR},
- </if>
- <if test="status != null and status !=''">
- status = #{status ,jdbcType=BIGINT},
- </if>
- <if test="remark != null and remark !=''">
- remark = #{remark ,jdbcType=VARCHAR},
- </if>
- <if test="accessTime != null">
- access_time = #{accessTime ,jdbcType=DATE},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="accessId != null">
- AND access_id = #{accessId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE oc_access
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="accessId != null">
- AND access_id = #{accessId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|