|
|
@@ -12,13 +12,14 @@
|
|
|
<result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
<result property="lockTime" column="lock_time" jdbcType="TIMESTAMP"/>
|
|
|
<result property="releaseTime" column="release_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="lastFollowTime" column="last_follow_time" jdbcType="TIMESTAMP"/>
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
id,pid,uid,
|
|
|
aid,type,lock_time,
|
|
|
- release_time,create_time
|
|
|
+ release_time,last_follow_time,create_time
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
@@ -28,7 +29,6 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
delete from restrict_project
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
@@ -37,10 +37,12 @@
|
|
|
insert into restrict_project
|
|
|
( id,pid,uid
|
|
|
,aid,type,lock_time
|
|
|
- ,release_time,create_time)
|
|
|
+ ,release_time,last_follow_time,create_time
|
|
|
+ )
|
|
|
values (#{id,jdbcType=INTEGER},#{pid,jdbcType=VARCHAR},#{uid,jdbcType=VARCHAR}
|
|
|
,#{aid,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{lockTime,jdbcType=TIMESTAMP}
|
|
|
- ,#{releaseTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP})
|
|
|
+ ,#{releaseTime,jdbcType=TIMESTAMP},#{lastFollowTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.RestrictProject" useGeneratedKeys="true">
|
|
|
insert into restrict_project
|
|
|
@@ -52,6 +54,7 @@
|
|
|
<if test="type != null">type,</if>
|
|
|
<if test="lockTime != null">lock_time,</if>
|
|
|
<if test="releaseTime != null">release_time,</if>
|
|
|
+ <if test="lastFollowTime != null">last_follow_time,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
@@ -62,6 +65,7 @@
|
|
|
<if test="type != null">#{type,jdbcType=INTEGER},</if>
|
|
|
<if test="lockTime != null">#{lockTime,jdbcType=TIMESTAMP},</if>
|
|
|
<if test="releaseTime != null">#{releaseTime,jdbcType=TIMESTAMP},</if>
|
|
|
+ <if test="lastFollowTime != null">#{lastFollowTime,jdbcType=TIMESTAMP},</if>
|
|
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
@@ -86,6 +90,9 @@
|
|
|
<if test="releaseTime != null">
|
|
|
release_time = #{releaseTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="lastFollowTime != null">
|
|
|
+ last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
<if test="createTime != null">
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
@@ -101,6 +108,7 @@
|
|
|
type = #{type,jdbcType=INTEGER},
|
|
|
lock_time = #{lockTime,jdbcType=TIMESTAMP},
|
|
|
release_time = #{releaseTime,jdbcType=TIMESTAMP},
|
|
|
+ last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -120,4 +128,35 @@
|
|
|
left join user c on b.uid=c.id left join admin d on b.aid=d.id
|
|
|
where a.restrict_status =1
|
|
|
</select>
|
|
|
+ <select id="RestrictProjectList" resultType="com.goafanti.business.bo.RestrictProjectPageList">
|
|
|
+ select a.id,b.nickname userName,c.bname projectName,a.`type` ,d.name userAdmin,d2.name adminName,a.lock_time ,a.last_follow_time
|
|
|
+ from restrict_project a
|
|
|
+ left join user b on a.uid =b.id left join business_project c on a.pid =c.id
|
|
|
+ left join admin d on b.aid =d.id left join admin d2 on a.aid =d2.id
|
|
|
+ where a.`type` >0
|
|
|
+ <include refid="RestrictProjectSql"/>
|
|
|
+ </select>
|
|
|
+ <sql id="RestrictProjectSql">
|
|
|
+ <if test="userName !=null">
|
|
|
+ and b.nickname like concat('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectName !=null">
|
|
|
+ and c.bname =#{projectName}
|
|
|
+ </if>
|
|
|
+ <if test="type !=null">
|
|
|
+ and a.`type` =#{type}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null and endTime !=null">
|
|
|
+ and a.last_follow_time between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="RestrictProjectCount" resultType="java.lang.Integer">
|
|
|
+ select count(*)
|
|
|
+ from restrict_project a
|
|
|
+ left join user b on a.uid =b.id left join business_project c on a.pid =c.id
|
|
|
+ left join admin d on b.aid =d.id left join admin d2 on a.aid =d2.id
|
|
|
+ where a.`type` >0
|
|
|
+ <include refid="RestrictProjectSql"/>
|
|
|
+ </select>
|
|
|
</mapper>
|