update 会员组

This commit is contained in:
2023-12-26 14:59:02 +08:00
parent f48e7fe992
commit 2174a550f5
8 changed files with 918 additions and 0 deletions

View File

@@ -0,0 +1,140 @@
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;
import java.math.BigDecimal;
/**
* 会员组对象 member_group
*
* @author jsowell
* @date 2023-12-26
*/
public class MemberGroup extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 会员组编号 */
@Excel(name = "会员组编号")
private String groupCode;
/** 运营商id */
@Excel(name = "运营商id")
private String merchantId;
/** 站点id */
@Excel(name = "站点id")
private String stationId;
/** 会员组等级 */
@Excel(name = "会员组等级")
private String groupLevel;
/** 类型1-服务费折扣2-电费折扣 3-电费和服务费一起折扣) */
@Excel(name = "类型", readConverterExp = "1=-服务费折扣2-电费折扣,=3-电费和服务费一起折扣")
private String groupType;
/** 折扣率 */
@Excel(name = "折扣率")
private BigDecimal discount;
/** 删除标识0-正常1-删除) */
private String delFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setGroupCode(String groupCode)
{
this.groupCode = groupCode;
}
public String getGroupCode()
{
return groupCode;
}
public void setMerchantId(String merchantId)
{
this.merchantId = merchantId;
}
public String getMerchantId()
{
return merchantId;
}
public void setStationId(String stationId)
{
this.stationId = stationId;
}
public String getStationId()
{
return stationId;
}
public void setGroupLevel(String groupLevel)
{
this.groupLevel = groupLevel;
}
public String getGroupLevel()
{
return groupLevel;
}
public void setGroupType(String groupType)
{
this.groupType = groupType;
}
public String getGroupType()
{
return groupType;
}
public void setDiscount(BigDecimal discount)
{
this.discount = discount;
}
public BigDecimal getDiscount()
{
return discount;
}
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("groupCode", getGroupCode())
.append("merchantId", getMerchantId())
.append("stationId", getStationId())
.append("groupLevel", getGroupLevel())
.append("groupType", getGroupType())
.append("discount", getDiscount())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@@ -0,0 +1,62 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberGroup;
import java.util.List;
/**
* 会员组Mapper接口
*
* @author jsowell
* @date 2023-12-26
*/
public interface MemberGroupMapper
{
/**
* 查询会员组
*
* @param id 会员组主键
* @return 会员组
*/
public MemberGroup selectMemberGroupById(Long id);
/**
* 查询会员组列表
*
* @param memberGroup 会员组
* @return 会员组集合
*/
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup);
/**
* 新增会员组
*
* @param memberGroup 会员组
* @return 结果
*/
public int insertMemberGroup(MemberGroup memberGroup);
/**
* 修改会员组
*
* @param memberGroup 会员组
* @return 结果
*/
public int updateMemberGroup(MemberGroup memberGroup);
/**
* 删除会员组
*
* @param id 会员组主键
* @return 结果
*/
public int deleteMemberGroupById(Long id);
/**
* 批量删除会员组
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMemberGroupByIds(Long[] ids);
}

View File

@@ -0,0 +1,62 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.MemberGroup;
import java.util.List;
/**
* 会员组Service接口
*
* @author jsowell
* @date 2023-12-26
*/
public interface MemberGroupService
{
/**
* 查询会员组
*
* @param id 会员组主键
* @return 会员组
*/
public MemberGroup selectMemberGroupById(Long id);
/**
* 查询会员组列表
*
* @param memberGroup 会员组
* @return 会员组集合
*/
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup);
/**
* 新增会员组
*
* @param memberGroup 会员组
* @return 结果
*/
public int insertMemberGroup(MemberGroup memberGroup);
/**
* 修改会员组
*
* @param memberGroup 会员组
* @return 结果
*/
public int updateMemberGroup(MemberGroup memberGroup);
/**
* 批量删除会员组
*
* @param ids 需要删除的会员组主键集合
* @return 结果
*/
public int deleteMemberGroupByIds(Long[] ids);
/**
* 删除会员组信息
*
* @param id 会员组主键
* @return 结果
*/
public int deleteMemberGroupById(Long id);
}

View File

@@ -0,0 +1,97 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.domain.MemberGroup;
import com.jsowell.pile.mapper.MemberGroupMapper;
import com.jsowell.pile.service.MemberGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 会员组Service业务层处理
*
* @author jsowell
* @date 2023-12-26
*/
@Service
public class MemberGroupServiceImpl implements MemberGroupService
{
@Autowired
private MemberGroupMapper memberGroupMapper;
/**
* 查询会员组
*
* @param id 会员组主键
* @return 会员组
*/
@Override
public MemberGroup selectMemberGroupById(Long id)
{
return memberGroupMapper.selectMemberGroupById(id);
}
/**
* 查询会员组列表
*
* @param memberGroup 会员组
* @return 会员组
*/
@Override
public List<MemberGroup> selectMemberGroupList(MemberGroup memberGroup)
{
return memberGroupMapper.selectMemberGroupList(memberGroup);
}
/**
* 新增会员组
*
* @param memberGroup 会员组
* @return 结果
*/
@Override
public int insertMemberGroup(MemberGroup memberGroup)
{
memberGroup.setCreateTime(DateUtils.getNowDate());
return memberGroupMapper.insertMemberGroup(memberGroup);
}
/**
* 修改会员组
*
* @param memberGroup 会员组
* @return 结果
*/
@Override
public int updateMemberGroup(MemberGroup memberGroup)
{
memberGroup.setUpdateTime(DateUtils.getNowDate());
return memberGroupMapper.updateMemberGroup(memberGroup);
}
/**
* 批量删除会员组
*
* @param ids 需要删除的会员组主键
* @return 结果
*/
@Override
public int deleteMemberGroupByIds(Long[] ids)
{
return memberGroupMapper.deleteMemberGroupByIds(ids);
}
/**
* 删除会员组信息
*
* @param id 会员组主键
* @return 结果
*/
@Override
public int deleteMemberGroupById(Long id)
{
return memberGroupMapper.deleteMemberGroupById(id);
}
}

View File

@@ -0,0 +1,103 @@
<?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.MemberGroupMapper">
<resultMap type="com.jsowell.pile.domain.MemberGroup" id="MemberGroupResult">
<result property="id" column="id" />
<result property="groupCode" column="group_code" />
<result property="merchantId" column="merchant_id" />
<result property="stationId" column="station_id" />
<result property="groupLevel" column="group_level" />
<result property="groupType" column="group_type" />
<result property="discount" column="discount" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectMemberGroupVo">
select id, group_code, merchant_id, station_id, group_level, group_type, discount, create_by, create_time, update_by, update_time, del_flag from member_group
</sql>
<select id="selectMemberGroupList" parameterType="com.jsowell.pile.domain.MemberGroup" resultMap="MemberGroupResult">
<include refid="selectMemberGroupVo"/>
<where>
<if test="groupCode != null and groupCode != ''"> and group_code = #{groupCode}</if>
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
<if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
<if test="groupLevel != null and groupLevel != ''"> and group_level = #{groupLevel}</if>
<if test="groupType != null and groupType != ''"> and group_type = #{groupType}</if>
<if test="discount != null "> and discount = #{discount}</if>
</where>
</select>
<select id="selectMemberGroupById" parameterType="Long" resultMap="MemberGroupResult">
<include refid="selectMemberGroupVo"/>
where id = #{id}
</select>
<insert id="insertMemberGroup" parameterType="com.jsowell.pile.domain.MemberGroup">
insert into member_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="groupCode != null">group_code,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="stationId != null">station_id,</if>
<if test="groupLevel != null">group_level,</if>
<if test="groupType != null">group_type,</if>
<if test="discount != null">discount,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="groupCode != null">#{groupCode},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="stationId != null">#{stationId},</if>
<if test="groupLevel != null">#{groupLevel},</if>
<if test="groupType != null">#{groupType},</if>
<if test="discount != null">#{discount},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateMemberGroup" parameterType="com.jsowell.pile.domain.MemberGroup">
update member_group
<trim prefix="SET" suffixOverrides=",">
<if test="groupCode != null">group_code = #{groupCode},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="groupLevel != null">group_level = #{groupLevel},</if>
<if test="groupType != null">group_type = #{groupType},</if>
<if test="discount != null">discount = #{discount},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMemberGroupById" parameterType="Long">
delete from member_group where id = #{id}
</delete>
<delete id="deleteMemberGroupByIds" parameterType="String">
delete from member_group where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>