| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- <?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.goafanti.common.dao.PatentNewMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="patent_no" jdbcType="VARCHAR" property="patentNo" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="apply_date" jdbcType="DATE" property="applyDate" />
- <result column="authorization_date" jdbcType="DATE" property="authorizationDate" />
- <result column="patent_amount" jdbcType="DECIMAL" property="patentAmount" />
- <result column="applicant" jdbcType="VARCHAR" property="applicant" />
- <result column="province" jdbcType="INTEGER" property="province" />
- <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
- <result column="email" jdbcType="VARCHAR" property="email" />
- <result column="certificate_url" jdbcType="VARCHAR" property="certificateUrl" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="years" jdbcType="INTEGER" property="years" />
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- id, patent_no, `name`, `type`, `status`, apply_date, authorization_date, patent_amount,
- applicant, province, contact_mobile, email, certificate_url, create_time, update_time,
- aid, `years`, `uid`
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- select
- <include refid="Base_Column_List" />
- from patent_new
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- delete from patent_new
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.PatentNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- insert into patent_new (id, patent_no, `name`,
- `type`, `status`, apply_date,
- authorization_date, patent_amount, applicant,
- province, contact_mobile, email,
- certificate_url, create_time, update_time,
- aid, `years`, `uid`)
- values (#{id,jdbcType=INTEGER}, #{patentNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
- #{type,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{applyDate,jdbcType=DATE},
- #{authorizationDate,jdbcType=DATE}, #{patentAmount,jdbcType=DECIMAL}, #{applicant,jdbcType=VARCHAR},
- #{province,jdbcType=INTEGER}, #{contactMobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
- #{certificateUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
- #{aid,jdbcType=VARCHAR}, #{years,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- insert into patent_new
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="patentNo != null">
- patent_no,
- </if>
- <if test="name != null">
- `name`,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="applyDate != null">
- apply_date,
- </if>
- <if test="authorizationDate != null">
- authorization_date,
- </if>
- <if test="patentAmount != null">
- patent_amount,
- </if>
- <if test="applicant != null">
- applicant,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="contactMobile != null">
- contact_mobile,
- </if>
- <if test="email != null">
- email,
- </if>
- <if test="certificateUrl != null">
- certificate_url,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="years != null">
- `years`,
- </if>
- <if test="uid != null">
- `uid`,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="patentNo != null">
- #{patentNo,jdbcType=VARCHAR},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="applyDate != null">
- #{applyDate,jdbcType=DATE},
- </if>
- <if test="authorizationDate != null">
- #{authorizationDate,jdbcType=DATE},
- </if>
- <if test="patentAmount != null">
- #{patentAmount,jdbcType=DECIMAL},
- </if>
- <if test="applicant != null">
- #{applicant,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- #{province,jdbcType=INTEGER},
- </if>
- <if test="contactMobile != null">
- #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="certificateUrl != null">
- #{certificateUrl,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- <if test="years != null">
- #{years,jdbcType=INTEGER},
- </if>
- <if test="uid != null">
- #{uid,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- update patent_new
- <set>
- <if test="patentNo != null">
- patent_no = #{patentNo,jdbcType=VARCHAR},
- </if>
- <if test="name != null">
- `name` = #{name,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="applyDate != null">
- apply_date = #{applyDate,jdbcType=DATE},
- </if>
- <if test="authorizationDate != null">
- authorization_date = #{authorizationDate,jdbcType=DATE},
- </if>
- <if test="patentAmount != null">
- patent_amount = #{patentAmount,jdbcType=DECIMAL},
- </if>
- <if test="applicant != null">
- applicant = #{applicant,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=INTEGER},
- </if>
- <if test="contactMobile != null">
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="certificateUrl != null">
- certificate_url = #{certificateUrl,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="years != null">
- `years` = #{years,jdbcType=INTEGER},
- </if>
- <if test="uid != null">
- `uid` = #{uid,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentNew">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu May 27 11:21:28 CST 2021.
- -->
- update patent_new
- set patent_no = #{patentNo,jdbcType=VARCHAR},
- `name` = #{name,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- `status` = #{status,jdbcType=INTEGER},
- apply_date = #{applyDate,jdbcType=DATE},
- authorization_date = #{authorizationDate,jdbcType=DATE},
- patent_amount = #{patentAmount,jdbcType=DECIMAL},
- applicant = #{applicant,jdbcType=VARCHAR},
- province = #{province,jdbcType=INTEGER},
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- email = #{email,jdbcType=VARCHAR},
- certificate_url = #{certificateUrl,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- aid = #{aid,jdbcType=VARCHAR},
- `years` = #{years,jdbcType=INTEGER},
- `uid` = #{uid,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
-
- <select id="selectPatentNewList" resultType="com.goafanti.patent.bo.PatentNewBo">
- select a.id,a.patent_no as patentNo,a.name,a.type,a.status,
- date_format(a.apply_date,'%Y-%m-%d') as applyDates,a.uid,
- date_format(a.authorization_date ,'%Y-%m-%d ')as authorizationDates,a.patent_amount as patentAmount,a.province,
- a.applicant,a.contact_mobile as contactMobile,a.email,a.certificate_url as certificateUrl,
- date_format(a.create_time,'%Y-%m-%d %H:%I:%S') as createTimeS,a.apply_date as applyDate,c.name depName,
- date_format(a.update_time,'%Y-%m-%d %H:%I:%S') as updateTimeS,b.name as aname,u.nickname userName
- from patent_new a left join admin b on a.aid=b.id
- left join `user` u on a.uid=u.id
- left join department c on b.department_id=c.id
- <if test="shiro ==1">
- left join admin e on e.department_id=c.id
- </if>
- where 1=1
- <if test="shiro ==0">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="shiro ==1">
- and e.id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status=#{status}
- </if>
- <if test="type != null">
- and a.type=#{type}
- </if>
- <if test="startDate != null and endDate != null">
- and a.apply_date between #{startDate} and #{endDate}
- </if>
- <if test="createStart != null and createEnd != null">
- and a.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="name != null">
- and a.applicant like concat('%',#{name},'%')
- </if>
- <if test="patentNo != null">
- and a.patent_no like concat('%',#{patentNo},'%')
- </if>
- <if test="aname != null">
- and b.name like concat('%',#{aname},'%')
- </if>
- <if test="departmentId != null">
- and b.department_id= #{departmentId}
- </if>
- order by a.status ,a.create_time
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="selectPatentNewCount" resultType="java.lang.Integer">
- select count(*)
- from patent_new a left join admin b on a.aid=b.id
- left join department c on b.department_id=c.id
- <if test="shiro ==1">
- left join admin e on e.department_id=c.id
- </if>
- where 1=1
- <if test="shiro ==0">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="shiro ==1">
- and e.id = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status=#{status}
- </if>
- <if test="type != null">
- and a.type=#{type}
- </if>
- <if test="startDate != null and endDate != null">
- and a.apply_date between #{startDate} and #{endDate}
- </if>
- <if test="createStart != null and createEnd != null">
- and a.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="name != null">
- and a.applicant like concat('%',#{name},'%')
- </if>
- <if test="patentNo != null">
- and a.patent_no like concat('%',#{patentNo},'%')
- </if>
- <if test="aname != null">
- and b.name like concat('%',#{aname},'%')
- </if>
- <if test="departmentId != null">
- and b.department_id= #{departmentId}
- </if>
- </select>
-
- <select id="AllselectStartPatentNew" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from patent_new where status < 8
- </select>
- <select id="AllselectEndPatentNew" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from patent_new where status =1
- </select>
-
- <update id="updateAdmin">
- update patent_new set aid= #{transferId}
- where aid= #{aid}
- </update>
- <insert id="insertBatch">
- insert into patent_new (patent_no, `name`,
- `type`, `status`, apply_date,
- authorization_date, patent_amount, applicant,
- province, contact_mobile, email,
- certificate_url, create_time, update_time,
- aid, `years`, `uid`)values
- <foreach item="item" index="index" collection="list" separator=",">
- ( #{item.aid,jdbcType=VARCHAR}, #{item.noticeType,jdbcType=INTEGER},
- #{item.content,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.readed,jdbcType=INTEGER},
- #{item.uid,jdbcType=VARCHAR}, #{item.pid,jdbcType=VARCHAR}, #{item.rid,jdbcType=VARCHAR},
- #{item.year,jdbcType=INTEGER}
- )
- </foreach>
- </insert>
-
-
- </mapper>
|