|
|
@@ -38,13 +38,14 @@
|
|
|
<result column="user_names" jdbcType="VARCHAR" property="userNames" />
|
|
|
<result column="object_type" jdbcType="INTEGER" property="objectType" />
|
|
|
<result column="public_type" jdbcType="INTEGER" property="publicType" />
|
|
|
+ <result column="district_name" jdbcType="VARCHAR" property="districtName" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, aid, release_start, release_end, remarks, annex_url, `status`, create_time, pid,
|
|
|
pname, duration, valid_date, supplement, audit_info, `plan`, expected_effect, next_plan,
|
|
|
`type`, order_no, update_time, update_status, assist, assist_aid, assist_aid_name,
|
|
|
main_id, main_name, reject_name, assistant_aid, assistant_name, public_again, audit_time,
|
|
|
- new_user, sign_sum, user_names, object_type, public_type
|
|
|
+ new_user, sign_sum, user_names, object_type, public_type, district_name
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -68,7 +69,8 @@
|
|
|
main_name, reject_name, assistant_aid,
|
|
|
assistant_name, public_again, audit_time,
|
|
|
new_user, sign_sum, user_names,
|
|
|
- object_type, public_type)
|
|
|
+ object_type, public_type, district_name
|
|
|
+ )
|
|
|
values (#{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP},
|
|
|
#{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
#{createTime,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR},
|
|
|
@@ -80,7 +82,8 @@
|
|
|
#{mainName,jdbcType=VARCHAR}, #{rejectName,jdbcType=VARCHAR}, #{assistantAid,jdbcType=VARCHAR},
|
|
|
#{assistantName,jdbcType=VARCHAR}, #{publicAgain,jdbcType=INTEGER}, #{auditTime,jdbcType=TIMESTAMP},
|
|
|
#{newUser,jdbcType=VARCHAR}, #{signSum,jdbcType=VARCHAR}, #{userNames,jdbcType=VARCHAR},
|
|
|
- #{objectType,jdbcType=INTEGER}, #{publicType,jdbcType=INTEGER})
|
|
|
+ #{objectType,jdbcType=INTEGER}, #{publicType,jdbcType=INTEGER}, #{districtName,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
insert into public_release
|
|
|
@@ -190,6 +193,9 @@
|
|
|
<if test="publicType != null">
|
|
|
public_type,
|
|
|
</if>
|
|
|
+ <if test="districtName != null">
|
|
|
+ district_name,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="aid != null">
|
|
|
@@ -297,6 +303,9 @@
|
|
|
<if test="publicType != null">
|
|
|
#{publicType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="districtName != null">
|
|
|
+ #{districtName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
|
|
|
@@ -407,6 +416,9 @@
|
|
|
<if test="publicType != null">
|
|
|
public_type = #{publicType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="districtName != null">
|
|
|
+ district_name = #{districtName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -446,7 +458,8 @@
|
|
|
sign_sum = #{signSum,jdbcType=VARCHAR},
|
|
|
user_names = #{userNames,jdbcType=VARCHAR},
|
|
|
object_type = #{objectType,jdbcType=INTEGER},
|
|
|
- public_type = #{publicType,jdbcType=INTEGER}
|
|
|
+ public_type = #{publicType,jdbcType=INTEGER},
|
|
|
+ district_name = #{districtName,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
@@ -461,16 +474,20 @@
|
|
|
<select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
|
|
|
select a.id ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.aid,
|
|
|
date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
|
|
|
- date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,x.district_name districtName,
|
|
|
+ date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,a.district_name districtName,
|
|
|
a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
|
|
|
a.assistant_aid assistantAid ,a.assistant_name assistantName,a.public_again publicAgain,a.user_names userNames
|
|
|
from public_release a left join admin c on a.aid =c.id
|
|
|
- left join (select min(prid)id,min(district_name)district_name from public_release_details group by prid )x on a.id=x.id
|
|
|
- <if test="type==2">
|
|
|
- left join department d on c.department_id =d.id
|
|
|
- </if>
|
|
|
+ <if test="type==4">
|
|
|
+ left join public_release_details b on a.id=b.prid
|
|
|
+ left join user e on b.uid=e.id
|
|
|
+ </if>
|
|
|
+ <if test="type==2">
|
|
|
+ left join department d on c.department_id =d.id
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="type==0">
|
|
|
+ and a.public_type in (0,2)
|
|
|
<if test="assist ==0">
|
|
|
and a.assist in(0,1)
|
|
|
</if>
|
|
|
@@ -483,37 +500,49 @@
|
|
|
<if test="assist ==4">
|
|
|
and a.assist in (2,3)
|
|
|
</if>
|
|
|
- <if test="aid !=null">
|
|
|
+ <if test="assistType ==1">
|
|
|
+ and a.assist in(0,1,2)
|
|
|
+ </if>
|
|
|
+ <if test="aid !=null">
|
|
|
and a.aid= #{aid}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
<if test="statusType ==1">
|
|
|
and a.status in (0,1,2,4)
|
|
|
</if>
|
|
|
- </if>
|
|
|
- <if test="type==1">
|
|
|
+ </if>
|
|
|
+ <if test="type==1">
|
|
|
+ and a.public_type in (0,2)
|
|
|
and a.assist in(0,1)
|
|
|
- and c.reviewer = #{aid}
|
|
|
- </if>
|
|
|
+ and c.reviewer = #{aid}
|
|
|
+ </if>
|
|
|
<if test="type==2">
|
|
|
+ and a.public_type in (0,2)
|
|
|
and a.assist in(0,1)
|
|
|
and d.manager_id = #{aid}
|
|
|
</if>
|
|
|
<if test="type==3">
|
|
|
- and a.assist in (2,3)
|
|
|
- <if test="aid !=null">
|
|
|
+ and a.public_type in (0,2)
|
|
|
+ and a.assist=2
|
|
|
+ <if test="aid !=null">
|
|
|
and a.aid= #{aid}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
and a.type = #{type}
|
|
|
</if>
|
|
|
- <if test="clockTime !=null">
|
|
|
- and a.release_start < #{clockTime} and a.release_end > #{clockTime}
|
|
|
- </if>
|
|
|
- <if test="releaseStarts != null and publicEnd != null">
|
|
|
- and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
|
|
|
- </if>
|
|
|
- <if test="status !=null">
|
|
|
- and a.status = #{status}
|
|
|
- </if>
|
|
|
+ <if test="type==4">
|
|
|
+ and a.assist in(0,1)
|
|
|
+ and e.aid = #{aid}
|
|
|
+ and a.public_type in (1,2)
|
|
|
+ </if>
|
|
|
+ <if test="clockTime !=null">
|
|
|
+ and a.release_start < #{clockTime} and a.release_end > #{clockTime}
|
|
|
+ </if>
|
|
|
+ <if test="releaseStarts != null and publicEnd != null">
|
|
|
+ and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="status !=null">
|
|
|
+ and a.status = #{status}
|
|
|
+ </if>
|
|
|
<if test="type==2">
|
|
|
ORDER BY a.create_time desc
|
|
|
</if>
|
|
|
@@ -532,8 +561,13 @@
|
|
|
<if test="type==2">
|
|
|
left join department d on c.department_id =d.id
|
|
|
</if>
|
|
|
+ <if test="type==4">
|
|
|
+ left join public_release_details b on a.id=b.prid
|
|
|
+ left join user e on b.uid=e.id
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="type==0">
|
|
|
+ and a.public_type in (0,2)
|
|
|
<if test="assist ==0">
|
|
|
and a.assist in(0,1)
|
|
|
</if>
|
|
|
@@ -557,20 +591,28 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="type==1">
|
|
|
+ and a.public_type in (0,2)
|
|
|
and a.assist in(0,1)
|
|
|
and c.reviewer = #{aid}
|
|
|
</if>
|
|
|
<if test="type==2">
|
|
|
+ and a.public_type in (0,2)
|
|
|
and a.assist in(0,1)
|
|
|
and d.manager_id = #{aid}
|
|
|
</if>
|
|
|
<if test="type==3">
|
|
|
+ and a.public_type in (0,2)
|
|
|
and a.assist=2
|
|
|
<if test="aid !=null">
|
|
|
and a.aid= #{aid}
|
|
|
</if>
|
|
|
and a.type = #{type}
|
|
|
</if>
|
|
|
+ <if test="type==4">
|
|
|
+ and a.assist in(0,1)
|
|
|
+ and e.aid = #{aid}
|
|
|
+ and a.public_type in (1,2)
|
|
|
+ </if>
|
|
|
<if test="clockTime !=null">
|
|
|
and a.release_start < #{clockTime} and a.release_end > #{clockTime}
|
|
|
</if>
|