ソースを参照

修改协单助手的新增和修改

anderx 3 年 前
コミット
10e90e0dfa

+ 18 - 6
src/main/java/com/goafanti/common/mapper/PublicReleaseDetailsMapper.xml

@@ -16,10 +16,11 @@
     <result column="district_name" jdbcType="VARCHAR" property="districtName" />
     <result column="clock_in_remarks" jdbcType="VARCHAR" property="clockInRemarks" />
     <result column="duration" jdbcType="DOUBLE" property="duration" />
+    <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
   </resultMap>
   <sql id="Base_Column_List">
     id, prid, `uid`, ufid, new_user, sign_sum, longitude, latitude, clock_in, clock_in_time,
-    photo_url, district_name, clock_in_remarks, duration
+    photo_url, district_name, clock_in_remarks, duration, main_status
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -36,12 +37,12 @@
       new_user, sign_sum, longitude,
       latitude, clock_in, clock_in_time,
       photo_url, district_name, clock_in_remarks,
-      duration)
+      duration, main_status)
     values (#{prid,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR},
       #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, #{longitude,jdbcType=VARCHAR},
       #{latitude,jdbcType=VARCHAR}, #{clockIn,jdbcType=INTEGER}, #{clockInTime,jdbcType=TIMESTAMP},
       #{photoUrl,jdbcType=VARCHAR}, #{districtName,jdbcType=VARCHAR}, #{clockInRemarks,jdbcType=VARCHAR},
-      #{duration,jdbcType=DOUBLE})
+      #{duration,jdbcType=DOUBLE}, #{mainStatus,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseDetails" useGeneratedKeys="true">
     insert into public_release_details
@@ -85,6 +86,9 @@
       <if test="duration != null">
         duration,
       </if>
+      <if test="mainStatus != null">
+        main_status,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="prid != null">
@@ -126,6 +130,9 @@
       <if test="duration != null">
         #{duration,jdbcType=DOUBLE},
       </if>
+      <if test="mainStatus != null">
+        #{mainStatus,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseDetails">
@@ -170,6 +177,9 @@
       <if test="duration != null">
         duration = #{duration,jdbcType=DOUBLE},
       </if>
+      <if test="mainStatus != null">
+        main_status = #{mainStatus,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -187,7 +197,8 @@
       photo_url = #{photoUrl,jdbcType=VARCHAR},
       district_name = #{districtName,jdbcType=VARCHAR},
       clock_in_remarks = #{clockInRemarks,jdbcType=VARCHAR},
-      duration = #{duration,jdbcType=DOUBLE}
+      duration = #{duration,jdbcType=DOUBLE},
+      main_status = #{mainStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -203,13 +214,14 @@
     insert into public_release_details (prid, `uid`, ufid,
     new_user, sign_sum, longitude,
     latitude, clock_in, clock_in_time,
-    photo_url, district_name,duration)
+    photo_url, district_name,duration,main_status)
     values
     <foreach  collection="list" item="prd"  separator=",">
       (#{prd.prid,jdbcType=INTEGER}, #{prd.uid,jdbcType=VARCHAR}, #{prd.ufid,jdbcType=VARCHAR},
       #{prd.newUser,jdbcType=INTEGER}, #{prd.signSum,jdbcType=INTEGER}, #{prd.longitude,jdbcType=VARCHAR},
       #{prd.latitude,jdbcType=VARCHAR}, #{prd.clockIn,jdbcType=INTEGER}, #{prd.clockInTime,jdbcType=TIMESTAMP},
-      #{prd.photoUrl,jdbcType=VARCHAR}, #{prd.districtName,jdbcType=VARCHAR},#{prd.duration,jdbcType=DOUBLE})
+      #{prd.photoUrl,jdbcType=VARCHAR}, #{prd.districtName,jdbcType=VARCHAR},#{prd.duration,jdbcType=DOUBLE},
+      #{prd.mainStatus,jdbcType=INTEGER})
     </foreach>
   </insert>
 

+ 5 - 4
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -464,20 +464,21 @@
   </update>
 
   <update id="updateSignByAidAndUid">
-    update public_release a ,(select max(create_time)create_time from public_release
-      where aid= #{aid} and uid=#{uid} and main_status =1 group by aid,uid)b
+    update public_release_details a left join public_release b on a.prid =b.id
+      left join `user` c on a.uid=c.id
     set a.sign_sum =a.sign_sum +1
-    where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
+    where a.uid=  #{uid} and a.main_status =1 and b.aid=  #{aid}
   </update>
 
 
   <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,
+    date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,x.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,district_name )x on a.id=x.id
   <if test="type==2">
     left join department d on c.department_id =d.id
   </if>

+ 13 - 0
src/main/java/com/goafanti/common/model/PublicReleaseDetails.java

@@ -75,6 +75,11 @@ public class PublicReleaseDetails implements Serializable {
      */
     private Double duration;
 
+    /**
+     * 0辅助 1主要(根据客户是否是公出人判断)
+     */
+    private Integer mainStatus;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -188,4 +193,12 @@ public class PublicReleaseDetails implements Serializable {
     public void setDuration(Double duration) {
         this.duration = duration;
     }
+
+    public Integer getMainStatus() {
+        return mainStatus;
+    }
+
+    public void setMainStatus(Integer mainStatus) {
+        this.mainStatus = mainStatus;
+    }
 }