123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?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.LicenseMapper">
- <resultMap id="OcLicenseDtoResultMap" type="com.zhyc.xps.sys.dto.LicenseDto">
- <result column="ocId" property="ocId" jdbcType="BIGINT" />
- <result column="lic_key" property="licKey" jdbcType="VARCHAR" />
- <result column="lic_value" property="licValue" jdbcType="VARCHAR" />
- <result column="expired_time" property="expiredTime" jdbcType="TIMESTAMP" />
- <result column="lic_desc" property="licDesc" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="OcLicenseDto_Cols">
- oc_id,
- lic_key,
- lic_value,
- expired_time,
- lic_desc
- </sql>
- <!--基于ID查询-->
- <select id="getByKey" resultMap="OcLicenseDtoResultMap">
- SELECT
- <include refid="OcLicenseDto_Cols"/>
- FROM oc_license
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- AND lic_key = #{licKey ,jdbcType=VARCHAR}
- </select>
- <!--列表查询-->
- <select id="getByList" resultMap="OcLicenseDtoResultMap">
- SELECT
- <include refid="OcLicenseDto_Cols"/>
- FROM oc_license
- WHERE deleted_flag = 0
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- </select>
- <!--新增 -->
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.OrgCat">
- INSERT INTO oc_license
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="licKey != null and licKey != ''">
- lic_key,
- </if>
- <if test="licValue != null and licValue !=''">
- lic_value,
- </if>
- <if test="expiredTime != null">
- expired_time,
- </if>
- <if test="licDesc != null and licDesc !=''">
- lic_desc,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="licKey != null and licKey != ''">
- #{licKey ,jdbcType=VARCHAR},
- </if>
- <if test="licValue != null and licValue != ''">
- #{licValue ,jdbcType=VARCHAR},
- </if>
- <if test="expiredTime != null">
- #{expiredTime ,jdbcType=TIMESTAMP},
- </if>
- <if test="licDesc != null and licDesc !=''">
- #{licDesc ,jdbcType=VARCHAR},
- </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.OrgCat">
- UPDATE oc_license
- <trim suffixOverrides=",">
- <set>
- <if test="licValue != null and licValue != ''">
- lic_value = #{licValue, jdbcType=VARCHAR},
- </if>
- <if test="expiredTime != null">
- expired_time = #{expiredTime ,jdbcType=TIMESTAMP},
- </if>
- <if test="licDesc != null and licDesc != ''">
- lic_desc = #{licDesc, jdbcType=VARCHAR},
- </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="ocId != null">
- AND oc_id = #{ocId, jdbcType=BIGINT}
- </if>
- <if test="licKey != null and licKey != ''">
- AND lic_key = #{licKey, jdbcType=VARCHAR}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE oc_license
- <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="ocId != null">
- AND oc_id = #{ocId, jdbcType=BIGINT}
- </if>
- <if test="licKey != null and licKey != ''">
- AND lic_key = #{licKey, jdbcType=VARCHAR}
- </if>
- </update>
- </mapper>
|