Просмотр исходного кода

修改新增、修改接口公出逻辑处理

anderx 1 год назад
Родитель
Сommit
6345a2ae54

+ 3 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseDateClockMapper.java

@@ -27,4 +27,7 @@ public interface PublicReleaseDateClockMapper {
     void insertBatch(List<PublicReleaseDateClock> list);
 
     List<PublicReleaseDateClock> selectByPrid(Integer id);
+
+
+    void deleteByPrid(Integer id);
 }

+ 24 - 14
src/main/java/com/goafanti/common/mapper/PublicReleaseDateClockMapper.xml

@@ -24,17 +24,13 @@
         from public_release_date_clock
         where  id = #{id,jdbcType=INTEGER} 
     </select>
-    <select id="selectByPrid" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List" />
-        from public_release_date_clock
-        where  prid = #{id,jdbcType=INTEGER}
-    </select>
+
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from public_release_date_clock
         where  id = #{id,jdbcType=INTEGER} 
     </delete>
+
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseDateClock" useGeneratedKeys="true">
         insert into public_release_date_clock
         ( id,prid,prdid
@@ -63,14 +59,7 @@
                 <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
         </trim>
     </insert>
-    <insert id="insertBatch">
-        insert into public_release_date_clock
-        (prid,prdid,status,clock_in_time)
-        values
-        <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.prid,jdbcType=INTEGER},#{item.prdid,jdbcType=INTEGER},#{item.status,jdbcType=INTEGER},#{item.clockInTime,jdbcType=TIMESTAMP})
-        </foreach>
-    </insert>
+
     <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseDateClock">
         update public_release_date_clock
         <set>
@@ -102,4 +91,25 @@
             create_time =  #{createTime,jdbcType=TIMESTAMP}
         where   id = #{id,jdbcType=INTEGER} 
     </update>
+
+    <delete id="deleteByPrid">
+        delete from public_release_date_clock
+        where  prid = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <insert id="insertBatch">
+        insert into public_release_date_clock
+        (prid,prdid,status,clock_in_time)
+        values
+        <foreach collection="list" item="item" index="index" separator=",">
+            (#{item.prid,jdbcType=INTEGER},#{item.prdid,jdbcType=INTEGER},#{item.status,jdbcType=INTEGER},#{item.clockInTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+
+    <select id="selectByPrid" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from public_release_date_clock
+        where  prid = #{id,jdbcType=INTEGER}
+    </select>
 </mapper>

+ 2 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -437,6 +437,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				publicReleaseMapper.updateByPrimaryKeySelective(out);
 			}
 		}
+		addPublicReleaseDateClock(in);
 		publicReleaseLogMapper.insertSelective(log);
 		publicReleaseMapper.updateByPrimaryKeySelective(in);
 
@@ -1856,6 +1857,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	}
 
 	private void addPublicReleaseDateClock(PublicRelease e) {
+		publicReleaseDateClockMapper.deleteByPrid(e.getId());
 		List<PublicReleaseDateClock> list= new ArrayList<>();
 		if (e.getValidDate()!=null){
 			List<Map> maps = JSONArray.parseArray(e.getValidDate(), Map.class);