会员发票抬头功能代码

This commit is contained in:
2023-04-13 14:47:13 +08:00
parent 635ca29e0b
commit ddf209b7c8
5 changed files with 505 additions and 0 deletions

View File

@@ -0,0 +1,174 @@
package com.jsowell.pile.domain;
import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 会员发票抬头对象 member_invoice_title
*
* @author jsowell
* @date 2023-04-13
*/
public class MemberInvoiceTitle extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 会员id
*/
@Excel(name = "会员id")
private String memberId;
/**
* 抬头类型1-单位2-个人)
*/
@Excel(name = "抬头类型", readConverterExp = "1=-单位2-个人")
private String titleType;
/**
* 单位名称
*/
@Excel(name = "单位名称")
private String name;
/**
* 税号
*/
@Excel(name = "税号")
private String taxId;
/**
* 单位地址
*/
@Excel(name = "单位地址")
private String unitAddress;
/**
* 电话号码
*/
@Excel(name = "电话号码")
private String phoneNumber;
/**
* 开户银行
*/
@Excel(name = "开户银行")
private String bankName;
/**
* 银行账户
*/
@Excel(name = "银行账户")
private String bankAccountNumber;
/**
* 删除标识0-正常1-删除)
*/
private String delFlag;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getMemberId() {
return memberId;
}
public void setTitleType(String titleType) {
this.titleType = titleType;
}
public String getTitleType() {
return titleType;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setTaxId(String taxId) {
this.taxId = taxId;
}
public String getTaxId() {
return taxId;
}
public void setUnitAddress(String unitAddress) {
this.unitAddress = unitAddress;
}
public String getUnitAddress() {
return unitAddress;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankName() {
return bankName;
}
public void setBankAccountNumber(String bankAccountNumber) {
this.bankAccountNumber = bankAccountNumber;
}
public String getBankAccountNumber() {
return bankAccountNumber;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("memberId", getMemberId())
.append("titleType", getTitleType())
.append("name", getName())
.append("taxId", getTaxId())
.append("unitAddress", getUnitAddress())
.append("phoneNumber", getPhoneNumber())
.append("bankName", getBankName())
.append("bankAccountNumber", getBankAccountNumber())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberInvoiceTitle;
import java.util.List;
/**
* 会员发票抬头Mapper接口
*
* @author jsowell
* @date 2023-04-13
*/
public interface MemberInvoiceTitleMapper {
/**
* 查询会员发票抬头
*
* @param id 会员发票抬头主键
* @return 会员发票抬头
*/
public MemberInvoiceTitle selectMemberInvoiceTitleById(Long id);
/**
* 查询会员发票抬头列表
*
* @param memberInvoiceTitle 会员发票抬头
* @return 会员发票抬头集合
*/
public List<MemberInvoiceTitle> selectMemberInvoiceTitleList(MemberInvoiceTitle memberInvoiceTitle);
/**
* 新增会员发票抬头
*
* @param memberInvoiceTitle 会员发票抬头
* @return 结果
*/
public int insertMemberInvoiceTitle(MemberInvoiceTitle memberInvoiceTitle);
/**
* 修改会员发票抬头
*
* @param memberInvoiceTitle 会员发票抬头
* @return 结果
*/
public int updateMemberInvoiceTitle(MemberInvoiceTitle memberInvoiceTitle);
/**
* 删除会员发票抬头
*
* @param id 会员发票抬头主键
* @return 结果
*/
public int deleteMemberInvoiceTitleById(Long id);
/**
* 批量删除会员发票抬头
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMemberInvoiceTitleByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.MemberInvoiceTitle;
import java.util.List;
/**
* 会员发票抬头Service接口
*
* @author jsowell
* @date 2023-04-13
*/
public interface IMemberInvoiceTitleService {
/**
* 查询会员发票抬头
*
* @param id 会员发票抬头主键
* @return 会员发票抬头
*/
public MemberInvoiceTitle selectMemberInvoiceTitleById(Long id);
/**
* 查询会员发票抬头列表
*
* @param memberInvoiceTitle 会员发票抬头
* @return 会员发票抬头集合
*/
public List<MemberInvoiceTitle> selectMemberInvoiceTitleList(MemberInvoiceTitle memberInvoiceTitle);
/**
* 新增会员发票抬头
*
* @param memberInvoiceTitle 会员发票抬头
* @return 结果
*/
public int insertMemberInvoiceTitle(MemberInvoiceTitle memberInvoiceTitle);
/**
* 修改会员发票抬头
*
* @param memberInvoiceTitle 会员发票抬头
* @return 结果
*/
public int updateMemberInvoiceTitle(MemberInvoiceTitle memberInvoiceTitle);
/**
* 批量删除会员发票抬头
*
* @param ids 需要删除的会员发票抬头主键集合
* @return 结果
*/
public int deleteMemberInvoiceTitleByIds(Long[] ids);
/**
* 删除会员发票抬头信息
*
* @param id 会员发票抬头主键
* @return 结果
*/
public int deleteMemberInvoiceTitleById(Long id);
}

View File

@@ -0,0 +1,90 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.domain.MemberInvoiceTitle;
import com.jsowell.pile.mapper.MemberInvoiceTitleMapper;
import com.jsowell.pile.service.IMemberInvoiceTitleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 会员发票抬头Service业务层处理
*
* @author jsowell
* @date 2023-04-13
*/
@Service
public class MemberInvoiceTitleServiceImpl implements IMemberInvoiceTitleService {
@Autowired
private MemberInvoiceTitleMapper memberInvoiceTitleMapper;
/**
* 查询会员发票抬头
*
* @param id 会员发票抬头主键
* @return 会员发票抬头
*/
@Override
public MemberInvoiceTitle selectMemberInvoiceTitleById(Long id) {
return memberInvoiceTitleMapper.selectMemberInvoiceTitleById(id);
}
/**
* 查询会员发票抬头列表
*
* @param memberInvoiceTitle 会员发票抬头
* @return 会员发票抬头
*/
@Override
public List<MemberInvoiceTitle> selectMemberInvoiceTitleList(MemberInvoiceTitle memberInvoiceTitle) {
return memberInvoiceTitleMapper.selectMemberInvoiceTitleList(memberInvoiceTitle);
}
/**
* 新增会员发票抬头
*
* @param memberInvoiceTitle 会员发票抬头
* @return 结果
*/
@Override
public int insertMemberInvoiceTitle(MemberInvoiceTitle memberInvoiceTitle) {
memberInvoiceTitle.setCreateTime(DateUtils.getNowDate());
return memberInvoiceTitleMapper.insertMemberInvoiceTitle(memberInvoiceTitle);
}
/**
* 修改会员发票抬头
*
* @param memberInvoiceTitle 会员发票抬头
* @return 结果
*/
@Override
public int updateMemberInvoiceTitle(MemberInvoiceTitle memberInvoiceTitle) {
memberInvoiceTitle.setUpdateTime(DateUtils.getNowDate());
return memberInvoiceTitleMapper.updateMemberInvoiceTitle(memberInvoiceTitle);
}
/**
* 批量删除会员发票抬头
*
* @param ids 需要删除的会员发票抬头主键
* @return 结果
*/
@Override
public int deleteMemberInvoiceTitleByIds(Long[] ids) {
return memberInvoiceTitleMapper.deleteMemberInvoiceTitleByIds(ids);
}
/**
* 删除会员发票抬头信息
*
* @param id 会员发票抬头主键
* @return 结果
*/
@Override
public int deleteMemberInvoiceTitleById(Long id) {
return memberInvoiceTitleMapper.deleteMemberInvoiceTitleById(id);
}
}

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.MemberInvoiceTitleMapper">
<resultMap type="com.jsowell.pile.domain.MemberInvoiceTitle" id="MemberInvoiceTitleResult">
<result property="id" column="id" />
<result property="memberId" column="member_id" />
<result property="titleType" column="title_type" />
<result property="name" column="name" />
<result property="taxId" column="tax_id" />
<result property="unitAddress" column="unit_address" />
<result property="phoneNumber" column="phone_number" />
<result property="bankName" column="bank_name" />
<result property="bankAccountNumber" column="bank_account_number" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="Base_Column_List">
id, member_id, title_type, name, tax_id, unit_address, phone_number, bank_name, bank_account_number,
create_time, create_by, update_time, update_by, del_flag
</sql>
<sql id="selectMemberInvoiceTitleVo">
select
<include refid="Base_Column_List">
</include>
from member_invoice_title
</sql>
<select id="selectMemberInvoiceTitleList" parameterType="com.jsowell.pile.domain.MemberInvoiceTitle" resultMap="MemberInvoiceTitleResult">
<include refid="selectMemberInvoiceTitleVo"/>
<where>
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
<if test="titleType != null and titleType != ''"> and title_type = #{titleType}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="taxId != null and taxId != ''"> and tax_id = #{taxId}</if>
<if test="unitAddress != null and unitAddress != ''"> and unit_address = #{unitAddress}</if>
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
<if test="bankName != null and bankName != ''"> and bank_name like concat('%', #{bankName}, '%')</if>
<if test="bankAccountNumber != null and bankAccountNumber != ''"> and bank_account_number = #{bankAccountNumber}</if>
</where>
</select>
<select id="selectMemberInvoiceTitleById" parameterType="Long" resultMap="MemberInvoiceTitleResult">
<include refid="selectMemberInvoiceTitleVo"/>
where id = #{id}
</select>
<insert id="insertMemberInvoiceTitle" parameterType="com.jsowell.pile.domain.MemberInvoiceTitle" useGeneratedKeys="true" keyProperty="id">
insert into member_invoice_title
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberId != null">member_id,</if>
<if test="titleType != null">title_type,</if>
<if test="name != null">name,</if>
<if test="taxId != null">tax_id,</if>
<if test="unitAddress != null">unit_address,</if>
<if test="phoneNumber != null">phone_number,</if>
<if test="bankName != null">bank_name,</if>
<if test="bankAccountNumber != null">bank_account_number,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberId != null">#{memberId},</if>
<if test="titleType != null">#{titleType},</if>
<if test="name != null">#{name},</if>
<if test="taxId != null">#{taxId},</if>
<if test="unitAddress != null">#{unitAddress},</if>
<if test="phoneNumber != null">#{phoneNumber},</if>
<if test="bankName != null">#{bankName},</if>
<if test="bankAccountNumber != null">#{bankAccountNumber},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateMemberInvoiceTitle" parameterType="com.jsowell.pile.domain.MemberInvoiceTitle">
update member_invoice_title
<trim prefix="SET" suffixOverrides=",">
<if test="memberId != null">member_id = #{memberId},</if>
<if test="titleType != null">title_type = #{titleType},</if>
<if test="name != null">name = #{name},</if>
<if test="taxId != null">tax_id = #{taxId},</if>
<if test="unitAddress != null">unit_address = #{unitAddress},</if>
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
<if test="bankName != null">bank_name = #{bankName},</if>
<if test="bankAccountNumber != null">bank_account_number = #{bankAccountNumber},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMemberInvoiceTitleById" parameterType="Long">
delete from member_invoice_title where id = #{id}
</delete>
<delete id="deleteMemberInvoiceTitleByIds" parameterType="String">
delete from member_invoice_title where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>