|
|
@@ -37,13 +37,14 @@
|
|
|
<result column="assist" jdbcType="INTEGER" property="assist" />
|
|
|
<result column="assist_aid" jdbcType="VARCHAR" property="assistAid" />
|
|
|
<result column="assist_aid_name" jdbcType="VARCHAR" property="assistAidName" />
|
|
|
+ <result column="main_id" jdbcType="INTEGER" property="mainId" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude,
|
|
|
latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname,
|
|
|
ufid, duration, valid_date, new_user, sign_sum, main_status, supplement, audit_info,
|
|
|
`plan`, expected_effect, next_plan, `type`, order_no, update_time, update_status,
|
|
|
- assist, assist_aid, assist_aid_name
|
|
|
+ assist, assist_aid, assist_aid_name, main_id
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -55,6 +56,7 @@
|
|
|
delete from public_release
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
+
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
insert into public_release (id, `uid`, aid,
|
|
|
release_start, release_end, remarks,
|
|
|
@@ -67,7 +69,7 @@
|
|
|
`plan`, expected_effect, next_plan,
|
|
|
`type`, order_no, update_time,
|
|
|
update_status, assist, assist_aid,
|
|
|
- assist_aid_name)
|
|
|
+ assist_aid_name, main_id)
|
|
|
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
|
|
|
#{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR},
|
|
|
#{annexUrl,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
|
|
|
@@ -79,7 +81,7 @@
|
|
|
#{plan,jdbcType=VARCHAR}, #{expectedEffect,jdbcType=VARCHAR}, #{nextPlan,jdbcType=VARCHAR},
|
|
|
#{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
#{updateStatus,jdbcType=INTEGER}, #{assist,jdbcType=INTEGER}, #{assistAid,jdbcType=VARCHAR},
|
|
|
- #{assistAidName,jdbcType=VARCHAR})
|
|
|
+ #{assistAidName,jdbcType=VARCHAR}, #{mainId,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
@@ -190,6 +192,9 @@
|
|
|
<if test="assistAidName != null">
|
|
|
assist_aid_name,
|
|
|
</if>
|
|
|
+ <if test="mainId != null">
|
|
|
+ main_id,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
|
@@ -297,6 +302,9 @@
|
|
|
<if test="assistAidName != null">
|
|
|
#{assistAidName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="mainId != null">
|
|
|
+ #{mainId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
|
|
|
@@ -404,6 +412,9 @@
|
|
|
<if test="assistAidName != null">
|
|
|
assist_aid_name = #{assistAidName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="mainId != null">
|
|
|
+ main_id = #{mainId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -442,7 +453,8 @@
|
|
|
update_status = #{updateStatus,jdbcType=INTEGER},
|
|
|
assist = #{assist,jdbcType=INTEGER},
|
|
|
assist_aid = #{assistAid,jdbcType=VARCHAR},
|
|
|
- assist_aid_name = #{assistAidName,jdbcType=VARCHAR}
|
|
|
+ assist_aid_name = #{assistAidName,jdbcType=VARCHAR},
|
|
|
+ main_id = #{mainId,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
@@ -453,11 +465,12 @@
|
|
|
where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
|
|
|
</update>
|
|
|
|
|
|
+
|
|
|
<select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
|
|
|
select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
|
|
|
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,
|
|
|
a.latitude ,a.longitude ,a.clock_in clockIn,date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,
|
|
|
-a.assist,a.assist_aid assistAid
|
|
|
+a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName
|
|
|
from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
|
|
|
<if test="type==2">
|
|
|
left join department d on c.department_id =d.id
|
|
|
@@ -694,4 +707,14 @@ a.assist,a.assist_aid assistAid
|
|
|
left join admin c on a.aid =c.id
|
|
|
where a.order_no = #{orderNo}
|
|
|
</select>
|
|
|
+ <select id="selectByMainId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from public_release
|
|
|
+ where main_id = #{mainId}
|
|
|
+ </select>
|
|
|
+ <update id="updateStatusByMainId">
|
|
|
+ update public_release set status= #{status}
|
|
|
+ where main_id= #{mainId}
|
|
|
+ </update>
|
|
|
</mapper>
|