Ver código fonte

将关联表改为真删除。

tomatozq 5 anos atrás
pai
commit
722aac58a0
1 arquivos alterados com 12 adições e 16 exclusões
  1. 12 16
      common/src/main/resources/mapper/base/PersonCompany.xml

+ 12 - 16
common/src/main/resources/mapper/base/PersonCompany.xml

@@ -24,14 +24,14 @@
 	    (id_,person_id,company_id,del_flag,create_by,create_time,update_by,update_time)
 		values
 		(
-#{id,jdbcType=VARCHAR}
-,#{personId,jdbcType= NUMERIC }
-,#{companyId,jdbcType=VARCHAR}
-,#{delFlag,jdbcType= NUMERIC }
-,#{createBy,jdbcType=VARCHAR}
-,#{createTime,jdbcType= TIMESTAMP }
-,#{updateBy,jdbcType=VARCHAR}
-,#{updateTime,jdbcType= TIMESTAMP }
+			#{id,jdbcType=VARCHAR}
+			,#{personId,jdbcType= NUMERIC }
+			,#{companyId,jdbcType=VARCHAR}
+			,#{delFlag,jdbcType= NUMERIC }
+			,#{createBy,jdbcType=VARCHAR}
+			,#{createTime,jdbcType= TIMESTAMP }
+			,#{updateBy,jdbcType=VARCHAR}
+			,#{updateTime,jdbcType= TIMESTAMP }
 		)
 	]]>
 	</insert>
@@ -66,8 +66,7 @@
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="PersonCompanyMap">
-		select 
-id_,person_id,company_id,del_flag,create_by,create_time,update_by,update_time		from base_person_company where id_=#{0}
+		select * from base_person_company where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_person_company where id_=#{0}
@@ -95,10 +94,7 @@ id_,person_id,company_id,del_flag,create_by,create_time,update_by,update_time		f
 	<select id="findByPersonId" resultMap="PersonCompanyMap" parameterType="long">
 		select * from base_person_company where del_flag =0 and person_id=#{personId}
 	</select>
-
-	<update id="deleteByPersonId" parameterType="long">
-		update base_person_company
-		set del_flag = 1
-		where person_id = #{personId}
-	</update>
+	<delete id="deleteByPersonId" parameterType="long">
+		delete base_person_company where person_id = #{personId}
+	</delete>
 </mapper>