123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?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="cn.cslg.pas.mapper.PermissionRecordMapper">
- <!--插入数据-->
- <!--int add(PermissionRecord permissionRecord);-->
- <insert id="add" useGeneratedKeys="true" keyProperty="id">
- insert into permission_record(id, patent_no, licensor, licensee, licensee_country, license_time,
- license_fee, license_dead_line, license_type, tenant_id, create_person_id,
- create_person_name, create_time, modified_time)
- values (#{id}, #{patentNo}, #{licensor}, #{licensee}, #{licenseeCountry},
- #{licenseTime}, #{licenseFee}, #{licenseDeadLine}, #{licenseType}, #{tenantId}, #{createPersonId},
- #{createPersonName}, #{createTime}, #{modifiedTime})
- </insert>
- <!--根据id修改数据-->
- <!--int update(PermissionRecordDTO permissionRecordDTO);-->
- <update id="update">
- update permission_record
- <set>
- <if test="patentNo != null">
- patent_no = #{patentNo},
- </if>
- <if test="licensor != null">
- licensor = #{licensor},
- </if>
- <if test="licensee != null">
- licensee = #{licensee},
- </if>
- <if test="licenseeCountry != null">
- licensee_country = #{licenseeCountry},
- </if>
- <if test="licenseTime != null">
- license_time = #{licenseTime},
- </if>
- <if test="licenseFee != null">
- license_fee = #{licenseFee},
- </if>
- <if test="licenseDeadLine != null">
- license_dead_line = #{licenseDeadLine},
- </if>
- <if test="licenseType != null">
- license_type = #{licenseType},
- </if>
- </set>
- where ID = #{id}
- </update>
- <!--根据patentNo专利号分页查询许可记录数据-->
- <!--;-->
- <resultMap id="permissionRecordMap" type="cn.cslg.pas.domain.PermissionRecord">
- <id column="id" property="id"/>
- <result column="patent_no" property="patentNo"/>
- <result column="licensor" property="licensor"/>
- <result column="licensee" property="licensee"/>
- <result column="licensee_country" property="licenseeCountry"/>
- <result column="license_time" property="licenseTime"/>
- <result column="license_fee" property="licenseFee"/>
- <result column="license_dead_line" property="licenseDeadLine"/>
- <result column="license_type" property="licenseType"/>
- <result column="create_person_id" property="createPersonId"/>
- <result column="create_person_name" property="createPersonName"/>
- <result column="create_time" property="createTime"/>
- <result column="modified_time" property="modifiedTime"/>
- </resultMap>
- <!--根据patentNo专利号分页查询许可记录数据-->
- <!--;-->
- <resultMap id="permissionRecordVOMap" type="cn.cslg.pas.common.model.vo.PermissionRecordVO">
- <id column="id" property="id"/>
- <result column="patent_no" property="patentNo"/>
- <result column="licensor" property="licensor"/>
- <result column="licensee" property="licensee"/>
- <result column="licensee_country" property="licenseeCountry"/>
- <result column="license_time" property="licenseTime"/>
- <result column="license_fee" property="licenseFee"/>
- <result column="license_dead_line" property="licenseDeadLine"/>
- <result column="license_type" property="licenseType"/>
- </resultMap>
- <select id="queryAllInfo" resultMap="permissionRecordVOMap">
- select id,
- patent_no,
- licensor,
- licensee,
- licensee_country,
- license_time,
- license_fee,
- license_dead_line,
- license_type,
- tenant_id
- from permission_record
- where patent_no = #{patentNo}
- and tenant_id = #{tenantId}
- </select>
- <!--根据专利号统计许可记录数量-->
- <!--int countByPatentNo();-->
- <select id="countByPatentNo" resultType="int">
- select count(*)
- from permission_record
- where patent_No = #{patentNo}
- and tenant_id = #{tenantId}
- </select>
- <!--根据许可id删除数据-->
- <!--int delete(Integer id);-->
- <delete id="delete">
- delete
- from permission_record
- where id = #{id}
- </delete>
- </mapper>
|