Commit 49afafc7 by guojuxing

添加delete_flag

parent 34457bdf
...@@ -12,13 +12,6 @@ import java.util.List; ...@@ -12,13 +12,6 @@ import java.util.List;
* @date 2020/9/11 11:36 AM
 * @date 2020/9/11 11:36 AM

*/ */
public interface TabCashWithdrawalMapper { public interface TabCashWithdrawalMapper {
/**
* 根据主键删除
*
* @param cashWithdrawalId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer cashWithdrawalId);
/** /**
* 插入一条记录 * 插入一条记录
......
...@@ -11,13 +11,7 @@ import java.util.List; ...@@ -11,13 +11,7 @@ import java.util.List;
* @date 2020/9/11 11:35 AM
 * @date 2020/9/11 11:35 AM

*/ */
public interface TabInvoiceAccountMapper { public interface TabInvoiceAccountMapper {
/**
* 根据主键删除
*
* @param invoiceAccountId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer invoiceAccountId);
/** /**
* 插入一条记录 * 插入一条记录
......
...@@ -13,13 +13,7 @@ import java.util.List; ...@@ -13,13 +13,7 @@ import java.util.List;
* @date 2020/9/11 11:35 AM
 * @date 2020/9/11 11:35 AM

*/ */
public interface TabInvoiceManageMapper { public interface TabInvoiceManageMapper {
/**
* 根据主键删除
*
* @param invoiceManageId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer invoiceManageId);
/** /**
* 插入一条记录 * 插入一条记录
......
...@@ -12,13 +12,6 @@ import java.util.List; ...@@ -12,13 +12,6 @@ import java.util.List;
* @date 2020/9/11 11:36 AM
 * @date 2020/9/11 11:36 AM

*/ */
public interface TabPayAccountMapper { public interface TabPayAccountMapper {
/**
* 根据主键删除
*
* @param payAccountId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer payAccountId);
/** /**
* 插入一条记录 * 插入一条记录
......
...@@ -14,13 +14,7 @@ import java.util.List; ...@@ -14,13 +14,7 @@ import java.util.List;
* @date 2020/9/11 11:33 AM
 * @date 2020/9/11 11:33 AM

*/ */
public interface TabTransferAccountsApprovalMapper { public interface TabTransferAccountsApprovalMapper {
/**
* 根据主键删除
*
* @param transferApprovalId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer transferApprovalId);
/** /**
* 插入一条记录 * 插入一条记录
......
...@@ -60,6 +60,8 @@ public class TabInvoiceAccount { ...@@ -60,6 +60,8 @@ public class TabInvoiceAccount {
*/ */
private Date updateTime; private Date updateTime;
private Integer deleteFlag;
public Integer getInvoiceAccountId() { public Integer getInvoiceAccountId() {
return invoiceAccountId; return invoiceAccountId;
} }
...@@ -139,4 +141,13 @@ public class TabInvoiceAccount { ...@@ -139,4 +141,13 @@ public class TabInvoiceAccount {
public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabInvoiceAccount setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
} }
\ No newline at end of file
...@@ -55,6 +55,8 @@ public class TabPayAccount { ...@@ -55,6 +55,8 @@ public class TabPayAccount {
*/ */
private Date updateTime; private Date updateTime;
private Integer deleteFlag;
public Integer getPayAccountId() { public Integer getPayAccountId() {
return payAccountId; return payAccountId;
} }
...@@ -126,4 +128,13 @@ public class TabPayAccount { ...@@ -126,4 +128,13 @@ public class TabPayAccount {
public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabPayAccount setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.gic.finance.dao.mapper.TabInvoiceAccountMapper; ...@@ -5,6 +5,7 @@ import com.gic.finance.dao.mapper.TabInvoiceAccountMapper;
import com.gic.finance.dto.InvoiceAccountDTO; import com.gic.finance.dto.InvoiceAccountDTO;
import com.gic.finance.entity.TabInvoiceAccount; import com.gic.finance.entity.TabInvoiceAccount;
import com.gic.finance.service.InvoiceAccountService; import com.gic.finance.service.InvoiceAccountService;
import com.gic.finance.util.DeleteFlagConstants;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -23,7 +24,9 @@ public class InvoiceAccountServiceImpl implements InvoiceAccountService{ ...@@ -23,7 +24,9 @@ public class InvoiceAccountServiceImpl implements InvoiceAccountService{
private TabInvoiceAccountMapper tabInvoiceAccountMapper; private TabInvoiceAccountMapper tabInvoiceAccountMapper;
@Override @Override
public void save(InvoiceAccountDTO dto) { public void save(InvoiceAccountDTO dto) {
tabInvoiceAccountMapper.insert(EntityUtil.changeEntityNew(TabInvoiceAccount.class, dto)); TabInvoiceAccount record = EntityUtil.changeEntityNew(TabInvoiceAccount.class, dto);
record.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
tabInvoiceAccountMapper.insert(record);
} }
@Override @Override
......
...@@ -3,6 +3,7 @@ package com.gic.finance.service.impl; ...@@ -3,6 +3,7 @@ package com.gic.finance.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.gic.finance.util.DeleteFlagConstants;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -25,7 +26,9 @@ public class PayAccountServiceImpl implements PayAccountService { ...@@ -25,7 +26,9 @@ public class PayAccountServiceImpl implements PayAccountService {
@Override @Override
public int save(PayAccountDTO dto) { public int save(PayAccountDTO dto) {
return tabPayAccountMapper.insert(EntityUtil.changeEntityNew(TabPayAccount.class, dto)); TabPayAccount record = EntityUtil.changeEntityNew(TabPayAccount.class, dto);
record.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
return tabPayAccountMapper.insert(record);
} }
@Override @Override
......
package com.gic.finance.util;
/**
* 数据删除标志常量
* @ClassName: DeleteFlagConstants

* @Description: 

* @author guojuxing

* @date 2020/10/13 4:12 PM

*/
public class DeleteFlagConstants {
/**
* 数据正常状态
*/
public static final int NORMAL_STATUS = 0;
/**
* 数据删除状态
*/
public static final int DELETE_STATUS = 1;
}
...@@ -44,10 +44,7 @@ ...@@ -44,10 +44,7 @@
from tab_cash_withdrawal from tab_cash_withdrawal
where cash_withdrawal_id = #{cashWithdrawalId,jdbcType=INTEGER} where cash_withdrawal_id = #{cashWithdrawalId,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_cash_withdrawal
where cash_withdrawal_id = #{cashWithdrawalId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.finance.entity.TabCashWithdrawal"> <insert id="insert" parameterType="com.gic.finance.entity.TabCashWithdrawal">
insert into tab_cash_withdrawal (cash_withdrawal_id, cash_withdrawal_serial_number, insert into tab_cash_withdrawal (cash_withdrawal_id, cash_withdrawal_serial_number,
apply_type, cash_withdrawal_amount, cash_withdrawal_status, apply_type, cash_withdrawal_amount, cash_withdrawal_status,
......
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
<result column="status" jdbcType="INTEGER" property="status" /> <result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
invoice_account_id, account_name, tax_number, address, bank, account_phone, bank_account, invoice_account_id, account_name, tax_number, address, bank, account_phone, bank_account,
status, create_time, update_time status, create_time, update_time, delete_flag
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
...@@ -23,19 +24,16 @@ ...@@ -23,19 +24,16 @@
from tab_invoice_account from tab_invoice_account
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER} where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_invoice_account
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.finance.entity.TabInvoiceAccount"> <insert id="insert" parameterType="com.gic.finance.entity.TabInvoiceAccount">
insert into tab_invoice_account (invoice_account_id, account_name, tax_number, insert into tab_invoice_account (invoice_account_id, account_name, tax_number,
address, bank, account_phone, address, bank, account_phone,
bank_account, status, create_time, bank_account, status, create_time,
update_time) update_time, delete_flag)
values (#{invoiceAccountId,jdbcType=INTEGER}, #{accountName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR}, values (#{invoiceAccountId,jdbcType=INTEGER}, #{accountName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{bank,jdbcType=VARCHAR}, #{accountPhone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{bank,jdbcType=VARCHAR}, #{accountPhone,jdbcType=VARCHAR},
#{bankAccount,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{bankAccount,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}) #{updateTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.finance.entity.TabInvoiceAccount"> <insert id="insertSelective" parameterType="com.gic.finance.entity.TabInvoiceAccount">
insert into tab_invoice_account insert into tab_invoice_account
...@@ -70,6 +68,9 @@ ...@@ -70,6 +68,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="invoiceAccountId != null"> <if test="invoiceAccountId != null">
...@@ -102,6 +103,9 @@ ...@@ -102,6 +103,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.finance.entity.TabInvoiceAccount"> <update id="updateByPrimaryKeySelective" parameterType="com.gic.finance.entity.TabInvoiceAccount">
...@@ -134,6 +138,9 @@ ...@@ -134,6 +138,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set> </set>
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER} where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</update> </update>
...@@ -147,7 +154,8 @@ ...@@ -147,7 +154,8 @@
bank_account = #{bankAccount,jdbcType=VARCHAR}, bank_account = #{bankAccount,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER}, status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER} where invoice_account_id = #{invoiceAccountId,jdbcType=INTEGER}
</update> </update>
...@@ -156,6 +164,7 @@ ...@@ -156,6 +164,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_invoice_account from tab_invoice_account
where status = 1 where status = 1
and delete_flag = 0
</select> </select>
<update id="closeStatus"> <update id="closeStatus">
...@@ -169,6 +178,8 @@ ...@@ -169,6 +178,8 @@
from tab_invoice_account from tab_invoice_account
where status != 0 where status != 0
and delete_flag = 0
order by status order by status
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -51,10 +51,7 @@ ...@@ -51,10 +51,7 @@
from tab_invoice_manage from tab_invoice_manage
where invoice_manage_id = #{invoiceManageId,jdbcType=INTEGER} where invoice_manage_id = #{invoiceManageId,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_invoice_manage
where invoice_manage_id = #{invoiceManageId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.finance.entity.TabInvoiceManage"> <insert id="insert" parameterType="com.gic.finance.entity.TabInvoiceManage">
insert into tab_invoice_manage (invoice_manage_id, invoice_apply_serial, insert into tab_invoice_manage (invoice_manage_id, invoice_apply_serial,
platform_type, invoice_type, billing_amount, platform_type, invoice_type, billing_amount,
......
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
<result column="sort" jdbcType="INTEGER" property="sort" /> <result column="sort" jdbcType="INTEGER" property="sort" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
pay_account_id, account_name, bank, branch_name, bank_account, status, sort, create_time, pay_account_id, account_name, bank, branch_name, bank_account, status, sort, create_time,
update_time update_time, delete_flag
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
...@@ -22,18 +23,15 @@ ...@@ -22,18 +23,15 @@
from tab_pay_account from tab_pay_account
where pay_account_id = #{payAccountId,jdbcType=INTEGER} where pay_account_id = #{payAccountId,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_pay_account
where pay_account_id = #{payAccountId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.finance.entity.TabPayAccount"> <insert id="insert" parameterType="com.gic.finance.entity.TabPayAccount">
insert into tab_pay_account (pay_account_id, account_name, bank, insert into tab_pay_account (pay_account_id, account_name, bank,
branch_name, bank_account, status, branch_name, bank_account, status,
sort, create_time, update_time sort, create_time, update_time, delete_flag
) )
values (#{payAccountId,jdbcType=INTEGER}, #{accountName,jdbcType=VARCHAR}, #{bank,jdbcType=VARCHAR}, values (#{payAccountId,jdbcType=INTEGER}, #{accountName,jdbcType=VARCHAR}, #{bank,jdbcType=VARCHAR},
#{branchName,jdbcType=VARCHAR}, #{bankAccount,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{branchName,jdbcType=VARCHAR}, #{bankAccount,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{sort,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} #{sort,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.finance.entity.TabPayAccount"> <insert id="insertSelective" parameterType="com.gic.finance.entity.TabPayAccount">
...@@ -66,6 +64,9 @@ ...@@ -66,6 +64,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="payAccountId != null"> <if test="payAccountId != null">
...@@ -95,6 +96,9 @@ ...@@ -95,6 +96,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.finance.entity.TabPayAccount"> <update id="updateByPrimaryKeySelective" parameterType="com.gic.finance.entity.TabPayAccount">
...@@ -124,6 +128,9 @@ ...@@ -124,6 +128,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set> </set>
where pay_account_id = #{payAccountId,jdbcType=INTEGER} where pay_account_id = #{payAccountId,jdbcType=INTEGER}
</update> </update>
...@@ -136,7 +143,8 @@ ...@@ -136,7 +143,8 @@
status = #{status,jdbcType=INTEGER}, status = #{status,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where pay_account_id = #{payAccountId,jdbcType=INTEGER} where pay_account_id = #{payAccountId,jdbcType=INTEGER}
</update> </update>
...@@ -145,6 +153,7 @@ ...@@ -145,6 +153,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_pay_account from tab_pay_account
where status != 0 where status != 0
and delete_flag = 0
order by sort order by sort
</select> </select>
...@@ -153,6 +162,7 @@ ...@@ -153,6 +162,7 @@
ifnull(max(sort), 0) ifnull(max(sort), 0)
from tab_pay_account from tab_pay_account
where status != 0 where status != 0
and delete_flag = 0
</select> </select>
<select id="getMinSort" resultType="int"> <select id="getMinSort" resultType="int">
...@@ -160,6 +170,7 @@ ...@@ -160,6 +170,7 @@
ifnull(min(sort),0) ifnull(min(sort),0)
from tab_pay_account from tab_pay_account
where status != 0 where status != 0
and delete_flag = 0
</select> </select>
...@@ -168,6 +179,7 @@ ...@@ -168,6 +179,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_pay_account from tab_pay_account
where status != 0 where status != 0
and delete_flag = 0
and sort &lt; #{sort} and sort &lt; #{sort}
</select> </select>
...@@ -176,6 +188,7 @@ ...@@ -176,6 +188,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_pay_account from tab_pay_account
where status != 0 where status != 0
and delete_flag = 0
and sort > #{sort} and sort > #{sort}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -38,10 +38,7 @@ ...@@ -38,10 +38,7 @@
from tab_transfer_accounts_approval from tab_transfer_accounts_approval
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER} where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_transfer_accounts_approval
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.finance.entity.TabTransferAccountsApproval"> <insert id="insert" parameterType="com.gic.finance.entity.TabTransferAccountsApproval">
insert into tab_transfer_accounts_approval (transfer_approval_id, order_number, insert into tab_transfer_accounts_approval (transfer_approval_id, order_number,
platform_type, initiator_type, initiator_name, platform_type, initiator_type, initiator_name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment