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.
udi-spms-java/src/main/resources/mybatis/mapper/auth/AuthLicenseDao.xml

55 lines
2.1 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.glxp.api.dao.auth.AuthLicenseDao">
<select id="get" resultType="com.glxp.api.entity.auth.AuthLicense">
SELECT *
FROM auth_license
where apiKey = #{id}
</select>
<insert id="save" keyProperty="id" parameterType="com.glxp.api.entity.auth.AuthLicense">
INSERT INTO auth_license(id, appid, name, apiKey, secretKey, createDate, customerId, companyName)
values (#{id}, #{appid}, #{name,jdbcType=VARCHAR}, #{apiKey,jdbcType=VARCHAR},
#{secretKey,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{customerId}, #{companyName})
</insert>
<update id="update" parameterType="com.glxp.api.entity.auth.AuthLicense">
UPDATE auth_license
<set>
<if test="appid != null">appid=#{appid},</if>
<if test="name != null">name=#{name},</if>
<if test="apiKey != null">apiKey=#{apiKey},</if>
<if test="secretKey != null">secretKey=#{secretKey},</if>
<if test="createDate != null">createDate=#{createDate}</if>
<if test="customerId != null">customerId=#{customerId}</if>
<if test="companyName != null">companyName=#{companyName}</if>
</set>
WHERE id=#{id}
</update>
<delete id="remove">
delete
from auth_license
where id = #{id}
</delete>
<delete id="romveByCustomerId">
delete
from auth_license
where customerId = #{customerId}
</delete>
<select id="selectLicenseByName" resultType="com.glxp.api.entity.auth.AuthLicense">
select apikey, secretkey from auth_license where name = #{name}
</select>
<update id="updateLicenseByName">
update auth_license
<set>
<if test="apikey != null">apikey=#{apikey},</if>
<if test="secretkey != null">secretkey=#{secretkey},</if>
</set>
where name = #{name}
</update>
</mapper>