Commit e6706209 by xugaojun

欢迎语适用范围,代码优化、模型优化

parent 1a3dd770
...@@ -36,6 +36,18 @@ public class WelcomeDetailDTO implements Serializable { ...@@ -36,6 +36,18 @@ public class WelcomeDetailDTO implements Serializable {
*/ */
private String suitDepartment; private String suitDepartment;
/** /**
* 适用部门名称, 以逗号分割
*/
private String suitDepartmentName;
/**
* 适用员工, 以逗号分割
*/
private String suitStaff;
/**
* 适用员工名称, 以逗号分割
*/
private String suitStaffName;
/**
* 欢迎语媒体列表 * 欢迎语媒体列表
*/ */
private List<WelcomeMediaDTO> welcomeMediaList; private List<WelcomeMediaDTO> welcomeMediaList;
...@@ -96,6 +108,30 @@ public class WelcomeDetailDTO implements Serializable { ...@@ -96,6 +108,30 @@ public class WelcomeDetailDTO implements Serializable {
this.welcomeMediaList = welcomeMediaList; this.welcomeMediaList = welcomeMediaList;
} }
public String getSuitDepartmentName() {
return suitDepartmentName;
}
public void setSuitDepartmentName(String suitDepartmentName) {
this.suitDepartmentName = suitDepartmentName;
}
public String getSuitStaff() {
return suitStaff;
}
public void setSuitStaff(String suitStaff) {
this.suitStaff = suitStaff;
}
public String getSuitStaffName() {
return suitStaffName;
}
public void setSuitStaffName(String suitStaffName) {
this.suitStaffName = suitStaffName;
}
@Override @Override
public String toString() { public String toString() {
return "WelcomeDetailDTO{" + return "WelcomeDetailDTO{" +
......
package com.gic.haoban.manage.api.enums;
/**
* desc:欢迎语适用类型枚举类
*
* @author: YongEn
* @date: 2022/2/11
**/
public enum WelcomeSuitTypeEnum {
/**
* 部门
*/
DEPARTMENT(1, "部门"),
STAFF(2, "员工"),
;
private final Integer code;
private final String desc;
WelcomeSuitTypeEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import java.util.Date; import java.util.Date;
import com.gic.haoban.manage.service.entity.TabHaobanFriendSetting; import com.gic.haoban.manage.service.entity.TabHaobanFriendSetting;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
/** /**
* 加好友配置表(TabHaobanFriendSetting)表数据库访问层 * 加好友配置表(TabHaobanFriendSetting)表数据库访问层
* *
...@@ -16,14 +17,14 @@ import java.util.List; ...@@ -16,14 +17,14 @@ import java.util.List;
@Repository @Repository
public interface TabHaobanFriendSettingMapper { public interface TabHaobanFriendSettingMapper {
/** /**
* 新增数据 * 新增数据
* *
* @param tabHaobanFriendSetting 实例对象 * @param tabHaobanFriendSetting 实例对象
* @return 影响行数 * @return 影响行数
*/ */
int insert(TabHaobanFriendSetting tabHaobanFriendSetting); int insert(TabHaobanFriendSetting tabHaobanFriendSetting);
/** /**
* 修改数据 * 修改数据
* *
...@@ -31,7 +32,7 @@ public interface TabHaobanFriendSettingMapper { ...@@ -31,7 +32,7 @@ public interface TabHaobanFriendSettingMapper {
* @return 影响行数 * @return 影响行数
*/ */
int update(TabHaobanFriendSetting tabHaobanFriendSetting); int update(TabHaobanFriendSetting tabHaobanFriendSetting);
/** /**
* 通过主键删除数据 * 通过主键删除数据
* *
...@@ -39,7 +40,7 @@ public interface TabHaobanFriendSettingMapper { ...@@ -39,7 +40,7 @@ public interface TabHaobanFriendSettingMapper {
* @return 影响行数 * @return 影响行数
*/ */
int deleteById(Long friendSettingId); int deleteById(Long friendSettingId);
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
...@@ -55,23 +56,32 @@ public interface TabHaobanFriendSettingMapper { ...@@ -55,23 +56,32 @@ public interface TabHaobanFriendSettingMapper {
* @return 对象列表 * @return 对象列表
*/ */
List<TabHaobanFriendSetting> queryAll(TabHaobanFriendSetting tabHaobanFriendSetting); List<TabHaobanFriendSetting> queryAll(TabHaobanFriendSetting tabHaobanFriendSetting);
/** /**
* 分页总数 * 分页总数
* *
* @return 对象列表 * @return 对象列表
*/ */
int queryCountByPage(); int queryCountByPage();
/** /**
* 分页列表 * 分页列表
* *
* @param offset 查询起始位置 * @param offset 查询起始位置
* @param limit 查询条数 * @param limit 查询条数
* @return 对象列表 * @return 对象列表
*/ */
List<TabHaobanFriendSetting> queryListByPage(@Param("offset") int offset, @Param("limit") int limit); List<TabHaobanFriendSetting> queryListByPage(@Param("offset") int offset, @Param("limit") int limit);
/**
* desc: 根据微信企业id查询单条记录
*
* @param wxEnterpriseId 微信企业id
* @return : {@link TabHaobanFriendSetting}
* @author : YongEn
* @date : 2022/2/11
*/
TabHaobanFriendSetting getByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
} }
...@@ -27,11 +27,12 @@ public interface TabHaobanWelcomeMapper { ...@@ -27,11 +27,12 @@ public interface TabHaobanWelcomeMapper {
* desc: 根据微信企业id查询列表 * desc: 根据微信企业id查询列表
* *
* @param wxEnterpriseId 微信企业id * @param wxEnterpriseId 微信企业id
* @param title 标题
* @return : {@link List< TabWelcome>} * @return : {@link List< TabWelcome>}
* @author : YongEn * @author : YongEn
* @date : 2022/2/9 * @date : 2022/2/9
*/ */
List<TabWelcome> listByWxEnterpriseId(String wxEnterpriseId); List<TabWelcome> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("title") String title);
/** /**
* desc: 根据微信企业id查询数量 * desc: 根据微信企业id查询数量
......
...@@ -22,24 +22,6 @@ public interface TabHaobanWelcomeMediaMapper { ...@@ -22,24 +22,6 @@ public interface TabHaobanWelcomeMediaMapper {
TabHaobanWelcomeMedia queryById(Long welcomeMediaId); TabHaobanWelcomeMedia queryById(Long welcomeMediaId);
/** /**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<TabHaobanWelcomeMedia> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
/**
* 通过实体作为筛选条件查询
*
* @param tabHaobanWelcomeMedia 实例对象
* @return 对象列表
*/
List<TabHaobanWelcomeMedia> queryAll(TabHaobanWelcomeMedia tabHaobanWelcomeMedia);
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanWelcomeMedia 实例对象 * @param tabHaobanWelcomeMedia 实例对象
...@@ -56,11 +38,23 @@ public interface TabHaobanWelcomeMediaMapper { ...@@ -56,11 +38,23 @@ public interface TabHaobanWelcomeMediaMapper {
int update(TabHaobanWelcomeMedia tabHaobanWelcomeMedia); int update(TabHaobanWelcomeMedia tabHaobanWelcomeMedia);
/** /**
* 通过主键删除数据 * desc: 通过欢迎语id删除(软删)
* *
* @param welcomeMediaId 主键 * @param welcomeId 欢迎语id
* @return 影响行数 * @return : {@link int}
* @author : YongEn
* @date : 2022/2/10
*/
int removeByWelcomeId(@Param("welcomeId") String welcomeId);
/**
* desc: 通过欢迎语id查询列表
*
* @param welcomeId 欢迎语id
* @return : {@link List< TabHaobanWelcomeMedia>}
* @author : YongEn
* @date : 2022/2/11
*/ */
int deleteById(Long welcomeMediaId); List<TabHaobanWelcomeMedia> listByWelcomeId(@Param("welcomeId") String welcomeId);
} }
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 欢迎语适用范围表(TabHaobanWelcomeSuitRang)表数据库访问层
*
* @author xugaojun
* @since 2022-02-10 16:40:16
*/
public interface TabHaobanWelcomeSuitRangMapper {
/**
* 通过ID查询单条数据
*
* @param welcomeSuitRangId 主键
* @return 实例对象
*/
TabHaobanWelcomeSuitRang queryById(Long welcomeSuitRangId);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<TabHaobanWelcomeSuitRang> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
/**
* 通过实体作为筛选条件查询
*
* @param tabHaobanWelcomeSuitRang 实例对象
* @return 对象列表
*/
List<TabHaobanWelcomeSuitRang> queryAll(TabHaobanWelcomeSuitRang tabHaobanWelcomeSuitRang);
/**
* 新增数据
*
* @param tabHaobanWelcomeSuitRang 实例对象
* @return 影响行数
*/
int insert(TabHaobanWelcomeSuitRang tabHaobanWelcomeSuitRang);
/**
* 修改数据
*
* @param tabHaobanWelcomeSuitRang 实例对象
* @return 影响行数
*/
int update(TabHaobanWelcomeSuitRang tabHaobanWelcomeSuitRang);
/**
* 通过主键删除数据
*
* @param welcomeSuitRangId 主键
* @return 影响行数
*/
int deleteById(Long welcomeSuitRangId);
}
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 欢迎语适用范围表(TabHaobanWelcomeSuitRang)实体类
*
* @author xugaojun
* @since 2022-02-10 16:40:15
*/
public class TabHaobanWelcomeSuitRang implements Serializable {
private static final long serialVersionUID = -99086648135131874L;
/**
* 主键id
*/
private Long welcomeSuitRangId;
/**
* 微信企业id
*/
private String wxEnterpriseId;
/**
* 欢迎语id
*/
private String welcomeId;
/**
* 适用范围类型 1部门 2员工
*/
private Integer suitType;
/**
* 适用部门id
*/
private String suitDepartmentId;
/**
* 适用部门名称
*/
private String suitDepartmentName;
/**
* 适用员工id
*/
private String suitStaffId;
/**
* 适用员工名称
*/
private String suitStaffName;
/**
* 员工所属部门id
*/
private String staffBelongDepartmentId;
/**
* 员工所属部门名称
*/
private String staffBelongDepartmentName;
/**
* 选中类型(部门)1被选中 2关联选中
*/
private Integer selectType;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否删除0否1是
*/
private Integer deleteFlag;
public Long getWelcomeSuitRangId() {
return welcomeSuitRangId;
}
public void setWelcomeSuitRangId(Long welcomeSuitRangId) {
this.welcomeSuitRangId = welcomeSuitRangId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getWelcomeId() {
return welcomeId;
}
public void setWelcomeId(String welcomeId) {
this.welcomeId = welcomeId;
}
public Integer getSuitType() {
return suitType;
}
public void setSuitType(Integer suitType) {
this.suitType = suitType;
}
public String getSuitDepartmentId() {
return suitDepartmentId;
}
public void setSuitDepartmentId(String suitDepartmentId) {
this.suitDepartmentId = suitDepartmentId;
}
public String getSuitDepartmentName() {
return suitDepartmentName;
}
public void setSuitDepartmentName(String suitDepartmentName) {
this.suitDepartmentName = suitDepartmentName;
}
public String getSuitStaffId() {
return suitStaffId;
}
public void setSuitStaffId(String suitStaffId) {
this.suitStaffId = suitStaffId;
}
public String getSuitStaffName() {
return suitStaffName;
}
public void setSuitStaffName(String suitStaffName) {
this.suitStaffName = suitStaffName;
}
public String getStaffBelongDepartmentId() {
return staffBelongDepartmentId;
}
public void setStaffBelongDepartmentId(String staffBelongDepartmentId) {
this.staffBelongDepartmentId = staffBelongDepartmentId;
}
public String getStaffBelongDepartmentName() {
return staffBelongDepartmentName;
}
public void setStaffBelongDepartmentName(String staffBelongDepartmentName) {
this.staffBelongDepartmentName = staffBelongDepartmentName;
}
public Integer getSelectType() {
return selectType;
}
public void setSelectType(Integer selectType) {
this.selectType = selectType;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
}
...@@ -58,15 +58,6 @@ public class TabWelcome implements Serializable { ...@@ -58,15 +58,6 @@ public class TabWelcome implements Serializable {
private Date updateTime; private Date updateTime;
/** /**
* 适用部门, 以逗号分割
*/
private String suitDepartment;
/**
* 适用员工, 以逗号分割
*/
private String suitStaff;
/**
* 操作人id * 操作人id
*/ */
private String operatorId; private String operatorId;
...@@ -148,22 +139,6 @@ public class TabWelcome implements Serializable { ...@@ -148,22 +139,6 @@ public class TabWelcome implements Serializable {
this.welcomeImg = welcomeImg; this.welcomeImg = welcomeImg;
} }
public String getSuitDepartment() {
return suitDepartment;
}
public String getSuitStaff() {
return suitStaff;
}
public void setSuitStaff(String suitStaff) {
this.suitStaff = suitStaff;
}
public void setSuitDepartment(String suitDepartment) {
this.suitDepartment = suitDepartment;
}
public String getOperatorId() { public String getOperatorId() {
return operatorId; return operatorId;
} }
......
...@@ -23,6 +23,14 @@ public class SaveFriendSettingBO { ...@@ -23,6 +23,14 @@ public class SaveFriendSettingBO {
* 4 不发送好办欢迎语,用企微欢迎语 * 4 不发送好办欢迎语,用企微欢迎语
*/ */
private Integer friendSettingType; private Integer friendSettingType;
/**
* 更新人id
*/
private String updateId;
/**
* 更新人名称
*/
private String updateName;
public Long getFriendSettingId() { public Long getFriendSettingId() {
return friendSettingId; return friendSettingId;
...@@ -48,6 +56,22 @@ public class SaveFriendSettingBO { ...@@ -48,6 +56,22 @@ public class SaveFriendSettingBO {
this.friendSettingType = friendSettingType; this.friendSettingType = friendSettingType;
} }
public String getUpdateId() {
return updateId;
}
public void setUpdateId(String updateId) {
this.updateId = updateId;
}
public String getUpdateName() {
return updateName;
}
public void setUpdateName(String updateName) {
this.updateName = updateName;
}
@Override @Override
public String toString() { public String toString() {
return "SaveFriendSettingBO{" + return "SaveFriendSettingBO{" +
......
...@@ -26,17 +26,33 @@ public class SaveWelcomeBO { ...@@ -26,17 +26,33 @@ public class SaveWelcomeBO {
*/ */
private String welcomeContent; private String welcomeContent;
/** /**
* 适用部门, 以逗号分割 * 操作人id
*/ */
private String suitDepartment; private String operatorId;
/** /**
* 适用员工, 以逗号分割 * 操作人名称
*/ */
private String suitStaff; private String operatorName;
/** /**
* 欢迎语媒体列表 * 欢迎语媒体列表
*/ */
private List<SaveWelcomeMediaBO> mediaList; private List<SaveWelcomeMediaBO> mediaList;
/**
* 适用部门新增列表
*/
private List<WelcomeSuitDepartmentBO> suitDepartmentAddList;
/**
* 适用部门删除列表
*/
private List<WelcomeSuitDepartmentBO> suitDepartmentDeleteList;
/**
* 适用员工新增列表
*/
private List<WelcomeSuitStaffBO> suitStaffAddList;
/**
* 适用员工删除列表
*/
private List<WelcomeSuitStaffBO> suitStaffDeleteList;
public String getWelcomeId() { public String getWelcomeId() {
return welcomeId; return welcomeId;
...@@ -70,28 +86,60 @@ public class SaveWelcomeBO { ...@@ -70,28 +86,60 @@ public class SaveWelcomeBO {
this.welcomeContent = welcomeContent; this.welcomeContent = welcomeContent;
} }
public String getSuitDepartment() { public List<SaveWelcomeMediaBO> getMediaList() {
return suitDepartment; return mediaList;
} }
public void setSuitDepartment(String suitDepartment) { public void setMediaList(List<SaveWelcomeMediaBO> mediaList) {
this.suitDepartment = suitDepartment; this.mediaList = mediaList;
} }
public String getSuitStaff() { public String getOperatorId() {
return suitStaff; return operatorId;
} }
public void setSuitStaff(String suitStaff) { public void setOperatorId(String operatorId) {
this.suitStaff = suitStaff; this.operatorId = operatorId;
} }
public List<SaveWelcomeMediaBO> getMediaList() { public String getOperatorName() {
return mediaList; return operatorName;
} }
public void setMediaList(List<SaveWelcomeMediaBO> mediaList) { public void setOperatorName(String operatorName) {
this.mediaList = mediaList; this.operatorName = operatorName;
}
public List<WelcomeSuitDepartmentBO> getSuitDepartmentAddList() {
return suitDepartmentAddList;
}
public void setSuitDepartmentAddList(List<WelcomeSuitDepartmentBO> suitDepartmentAddList) {
this.suitDepartmentAddList = suitDepartmentAddList;
}
public List<WelcomeSuitDepartmentBO> getSuitDepartmentDeleteList() {
return suitDepartmentDeleteList;
}
public void setSuitDepartmentDeleteList(List<WelcomeSuitDepartmentBO> suitDepartmentDeleteList) {
this.suitDepartmentDeleteList = suitDepartmentDeleteList;
}
public List<WelcomeSuitStaffBO> getSuitStaffAddList() {
return suitStaffAddList;
}
public void setSuitStaffAddList(List<WelcomeSuitStaffBO> suitStaffAddList) {
this.suitStaffAddList = suitStaffAddList;
}
public List<WelcomeSuitStaffBO> getSuitStaffDeleteList() {
return suitStaffDeleteList;
}
public void setSuitStaffDeleteList(List<WelcomeSuitStaffBO> suitStaffDeleteList) {
this.suitStaffDeleteList = suitStaffDeleteList;
} }
@Override @Override
...@@ -101,9 +149,13 @@ public class SaveWelcomeBO { ...@@ -101,9 +149,13 @@ public class SaveWelcomeBO {
", wxEnterpriseId='" + wxEnterpriseId + '\'' + ", wxEnterpriseId='" + wxEnterpriseId + '\'' +
", title='" + title + '\'' + ", title='" + title + '\'' +
", welcomeContent='" + welcomeContent + '\'' + ", welcomeContent='" + welcomeContent + '\'' +
", suitDepartment='" + suitDepartment + '\'' + ", operatorId='" + operatorId + '\'' +
", suitStaff='" + suitStaff + '\'' + ", operatorName='" + operatorName + '\'' +
", mediaList=" + mediaList + ", mediaList=" + mediaList +
", suitDepartmentAddList=" + suitDepartmentAddList +
", suitDepartmentDeleteList=" + suitDepartmentDeleteList +
", suitStaffAddList=" + suitStaffAddList +
", suitStaffDeleteList=" + suitStaffDeleteList +
'}'; '}';
} }
} }
...@@ -30,13 +30,13 @@ public class WelcomeDetailBO { ...@@ -30,13 +30,13 @@ public class WelcomeDetailBO {
*/ */
private Integer openFlag; private Integer openFlag;
/** /**
* 适用部门, 以逗号分割 * 适用部门列表
*/ */
private String suitDepartment; private List<WelcomeSuitDepartmentBO> suitDepartmentList;
/** /**
* 适用员工, 以逗号分割 * 适用员工列表
*/ */
private String suitStaff; private List<WelcomeSuitStaffBO> suitStaffList;
/** /**
* 欢迎语媒体列表 * 欢迎语媒体列表
*/ */
...@@ -82,28 +82,28 @@ public class WelcomeDetailBO { ...@@ -82,28 +82,28 @@ public class WelcomeDetailBO {
this.openFlag = openFlag; this.openFlag = openFlag;
} }
public String getSuitDepartment() { public List<WelcomeMediaBO> getWelcomeMediaList() {
return suitDepartment; return welcomeMediaList;
} }
public void setSuitDepartment(String suitDepartment) { public void setWelcomeMediaList(List<WelcomeMediaBO> welcomeMediaList) {
this.suitDepartment = suitDepartment; this.welcomeMediaList = welcomeMediaList;
} }
public String getSuitStaff() { public List<WelcomeSuitDepartmentBO> getSuitDepartmentList() {
return suitStaff; return suitDepartmentList;
} }
public void setSuitStaff(String suitStaff) { public void setSuitDepartmentList(List<WelcomeSuitDepartmentBO> suitDepartmentList) {
this.suitStaff = suitStaff; this.suitDepartmentList = suitDepartmentList;
} }
public List<WelcomeMediaBO> getWelcomeMediaList() { public List<WelcomeSuitStaffBO> getSuitStaffList() {
return welcomeMediaList; return suitStaffList;
} }
public void setWelcomeMediaList(List<WelcomeMediaBO> welcomeMediaList) { public void setSuitStaffList(List<WelcomeSuitStaffBO> suitStaffList) {
this.welcomeMediaList = welcomeMediaList; this.suitStaffList = suitStaffList;
} }
@Override @Override
...@@ -114,7 +114,6 @@ public class WelcomeDetailBO { ...@@ -114,7 +114,6 @@ public class WelcomeDetailBO {
", title='" + title + '\'' + ", title='" + title + '\'' +
", welcomeContent='" + welcomeContent + '\'' + ", welcomeContent='" + welcomeContent + '\'' +
", openFlag=" + openFlag + ", openFlag=" + openFlag +
", suitDepartment='" + suitDepartment + '\'' +
", welcomeMediaList=" + welcomeMediaList + ", welcomeMediaList=" + welcomeMediaList +
'}'; '}';
} }
......
...@@ -35,14 +35,6 @@ public class WelcomeListBO { ...@@ -35,14 +35,6 @@ public class WelcomeListBO {
*/ */
private Date updateTime; private Date updateTime;
/** /**
* 适用部门, 以逗号分割
*/
private String suitDepartment;
/**
* 适用员工, 以逗号分割
*/
private String suitStaff;
/**
* 操作人id * 操作人id
*/ */
private String operatorId; private String operatorId;
...@@ -51,6 +43,14 @@ public class WelcomeListBO { ...@@ -51,6 +43,14 @@ public class WelcomeListBO {
*/ */
private String operatorName; private String operatorName;
/** /**
* 适用部门列表
*/
private List<WelcomeSuitDepartmentBO> suitDepartmentList;
/**
* 适用员工列表
*/
private List<WelcomeSuitStaffBO> suitStaffList;
/**
* 欢迎语媒体列表 * 欢迎语媒体列表
*/ */
private List<WelcomeMediaBO> welcomeMediaList; private List<WelcomeMediaBO> welcomeMediaList;
...@@ -95,22 +95,6 @@ public class WelcomeListBO { ...@@ -95,22 +95,6 @@ public class WelcomeListBO {
this.openFlag = openFlag; this.openFlag = openFlag;
} }
public String getSuitDepartment() {
return suitDepartment;
}
public void setSuitDepartment(String suitDepartment) {
this.suitDepartment = suitDepartment;
}
public String getSuitStaff() {
return suitStaff;
}
public void setSuitStaff(String suitStaff) {
this.suitStaff = suitStaff;
}
public List<WelcomeMediaBO> getWelcomeMediaList() { public List<WelcomeMediaBO> getWelcomeMediaList() {
return welcomeMediaList; return welcomeMediaList;
} }
...@@ -143,6 +127,22 @@ public class WelcomeListBO { ...@@ -143,6 +127,22 @@ public class WelcomeListBO {
this.operatorName = operatorName; this.operatorName = operatorName;
} }
public List<WelcomeSuitDepartmentBO> getSuitDepartmentList() {
return suitDepartmentList;
}
public void setSuitDepartmentList(List<WelcomeSuitDepartmentBO> suitDepartmentList) {
this.suitDepartmentList = suitDepartmentList;
}
public List<WelcomeSuitStaffBO> getSuitStaffList() {
return suitStaffList;
}
public void setSuitStaffList(List<WelcomeSuitStaffBO> suitStaffList) {
this.suitStaffList = suitStaffList;
}
@Override @Override
public String toString() { public String toString() {
return "WelcomeListBO{" + return "WelcomeListBO{" +
...@@ -152,7 +152,6 @@ public class WelcomeListBO { ...@@ -152,7 +152,6 @@ public class WelcomeListBO {
", welcomeContent='" + welcomeContent + '\'' + ", welcomeContent='" + welcomeContent + '\'' +
", openFlag=" + openFlag + ", openFlag=" + openFlag +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", suitDepartment='" + suitDepartment + '\'' +
", operatorId='" + operatorId + '\'' + ", operatorId='" + operatorId + '\'' +
", operatorName='" + operatorName + '\'' + ", operatorName='" + operatorName + '\'' +
", welcomeMediaList=" + welcomeMediaList + ", welcomeMediaList=" + welcomeMediaList +
......
package com.gic.haoban.manage.service.pojo.bo.welcome;
/**
* desc:欢迎语适用部门bo
*
* @author: YongEn
* @date: 2022/2/10
**/
public class WelcomeSuitDepartmentBO {
/**
* 部门id
*/
private String departmentId;
/**
* 部门名称
*/
private String departmentName;
/**
* 选中类型(部门)1被选中 2关联选中
*/
private Integer selectType;
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public Integer getSelectType() {
return selectType;
}
public void setSelectType(Integer selectType) {
this.selectType = selectType;
}
@Override
public String toString() {
return "WelcomeSuitDepartmentBO{" +
"departmentId='" + departmentId + '\'' +
", departmentName='" + departmentName + '\'' +
'}';
}
}
package com.gic.haoban.manage.service.pojo.bo.welcome;
/**
* desc:欢迎语适用员工bo
*
* @author: YongEn
* @date: 2022/2/10
**/
public class WelcomeSuitStaffBO {
/**
* 员工id
*/
private String staffId;
/**
* 员工名称
*/
private String staffName;
/**
* 员工所属部门id
*/
private String belongDepartmentId;
/**
* 员工所属部门名称
*/
private String belongDepartmentName;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getBelongDepartmentId() {
return belongDepartmentId;
}
public void setBelongDepartmentId(String belongDepartmentId) {
this.belongDepartmentId = belongDepartmentId;
}
public String getBelongDepartmentName() {
return belongDepartmentName;
}
public void setBelongDepartmentName(String belongDepartmentName) {
this.belongDepartmentName = belongDepartmentName;
}
@Override
public String toString() {
return "WelcomeSuitStaffBO{" +
"staffId='" + staffId + '\'' +
", staffName='" + staffName + '\'' +
", belongDepartmentId='" + belongDepartmentId + '\'' +
", belongDepartmentName='" + belongDepartmentName + '\'' +
'}';
}
}
...@@ -30,17 +30,18 @@ public interface WelcomeService { ...@@ -30,17 +30,18 @@ public interface WelcomeService {
* @author : YongEn * @author : YongEn
* @date : 2022/2/8 * @date : 2022/2/8
*/ */
Boolean removeWelcome(Long welcomeId); Boolean removeWelcome(String welcomeId);
/** /**
* desc: 获取欢迎语列表 * desc: 获取欢迎语列表
* *
* @param wxEnterpriseId 微信企业id * @param wxEnterpriseId 微信企业id
* @param title 标题
* @return : {@link List< WelcomeListBO >} * @return : {@link List< WelcomeListBO >}
* @author : YongEn * @author : YongEn
* @date : 2022/2/8 * @date : 2022/2/8
*/ */
List<WelcomeListBO> listWelcome(String wxEnterpriseId); List<WelcomeListBO> listWelcome(String wxEnterpriseId, String title);
/** /**
* desc: 获取欢迎语详情 * desc: 获取欢迎语详情
...@@ -50,7 +51,7 @@ public interface WelcomeService { ...@@ -50,7 +51,7 @@ public interface WelcomeService {
* @author : YongEn * @author : YongEn
* @date : 2022/2/8 * @date : 2022/2/8
*/ */
WelcomeDetailBO getWelcome(Long welcomeId); WelcomeDetailBO getWelcome(String welcomeId);
/** /**
* desc: 保存加好友配置 * desc: 保存加好友配置
...@@ -81,6 +82,6 @@ public interface WelcomeService { ...@@ -81,6 +82,6 @@ public interface WelcomeService {
* @author : YongEn * @author : YongEn
* @date : 2022/2/9 * @date : 2022/2/9
*/ */
WelcomeDetailBO getMatchWelcomeByDept(String staffId, String wxEnterpriseId); WelcomeDetailBO getMatchWelcome(String staffId, String wxEnterpriseId);
} }
package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitDepartmentBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitStaffBO;
import java.util.List;
/**
* desc:欢迎语适用范围服务接口
*
* @author: YongEn
* @date: 2022/2/10
**/
public interface WelcomeSuitRangService {
/**
* desc: 新增适用部门
*
* @param welcomeId 欢迎语id
* @param suitDepartmentList 适用门店列表
* @param wxEnterpriseId 微信企业id
* @author : YongEn
* @date : 2022/2/10
*/
void addSuitDepartment(String welcomeId, String wxEnterpriseId, List<WelcomeSuitDepartmentBO> suitDepartmentList);
/**
* desc: 新增适用员工
*
* @param welcomeId 欢迎语id
* @param suitStaffList 适用员工列表
* @param wxEnterpriseId 微信企业id
* @author : YongEn
* @date : 2022/2/10
*/
void addSuitStaff(String welcomeId, String wxEnterpriseId, List<WelcomeSuitStaffBO> suitStaffList);
/**
* desc: 删除适用部门
*
* @param welcomeId 欢迎语id
* @param suitDepartmentList 适用门店列表
* @param wxEnterpriseId 微信企业id
* @author : YongEn
* @date : 2022/2/10
*/
void deleteSuitDepartment(String welcomeId, String wxEnterpriseId, List<WelcomeSuitDepartmentBO> suitDepartmentList);
/**
* desc: 删除适用员工
*
* @param welcomeId 欢迎语id
* @param suitStaffList 适用员工列表
* @param wxEnterpriseId 微信企业id
* @author : YongEn
* @date : 2022/2/10
*/
void deleteSuitStaff(String welcomeId, String wxEnterpriseId, List<WelcomeSuitStaffBO> suitStaffList);
}
package com.gic.haoban.manage.service.service.impl;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.enums.WelcomeSuitTypeEnum;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeSuitRangMapper;
import com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitDepartmentBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitStaffBO;
import com.gic.haoban.manage.service.service.WelcomeSuitRangService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* desc:欢迎语适用范围服务接口实现
*
* @author: YongEn
* @date: 2022/2/10
**/
@Service
public class WelcomeSuitRangServiceImpl implements WelcomeSuitRangService {
@Autowired
private TabHaobanWelcomeSuitRangMapper welcomeSuitRangMapper;
@Override
public void addSuitDepartment(String welcomeId, String wxEnterpriseId, List<WelcomeSuitDepartmentBO> suitDepartmentList) {
if (CollectionUtils.isEmpty(suitDepartmentList)) {
return;
}
// 构建实体类
List<TabHaobanWelcomeSuitRang> welcomeSuitRangList = suitDepartmentList.stream().map(one -> {
TabHaobanWelcomeSuitRang welcomeSuitRang = new TabHaobanWelcomeSuitRang();
welcomeSuitRang.setWelcomeSuitRangId(UniqueIdUtils.uniqueLong());
welcomeSuitRang.setWxEnterpriseId(wxEnterpriseId);
welcomeSuitRang.setWelcomeId(welcomeId);
welcomeSuitRang.setSuitType(WelcomeSuitTypeEnum.DEPARTMENT.getCode());
welcomeSuitRang.setSuitDepartmentId(one.getDepartmentId());
welcomeSuitRang.setSuitDepartmentName(one.getDepartmentName());
welcomeSuitRang.setSelectType(one.getSelectType());
return welcomeSuitRang;
}).collect(Collectors.toList());
// TODO: 2022/2/11 批量新增
}
@Override
public void addSuitStaff(String welcomeId, String wxEnterpriseId, List<WelcomeSuitStaffBO> suitStaffList) {
if (CollectionUtils.isEmpty(suitStaffList)) {
return;
}
// 构建实体类
List<TabHaobanWelcomeSuitRang> welcomeSuitRangList = suitStaffList.stream().map(one -> {
TabHaobanWelcomeSuitRang welcomeSuitRang = new TabHaobanWelcomeSuitRang();
welcomeSuitRang.setWelcomeSuitRangId(UniqueIdUtils.uniqueLong());
welcomeSuitRang.setWxEnterpriseId(wxEnterpriseId);
welcomeSuitRang.setWelcomeId(welcomeId);
welcomeSuitRang.setSuitType(WelcomeSuitTypeEnum.STAFF.getCode());
welcomeSuitRang.setSuitStaffId(one.getStaffId());
welcomeSuitRang.setSuitStaffName(one.getStaffName());
welcomeSuitRang.setStaffBelongDepartmentId(one.getBelongDepartmentId());
welcomeSuitRang.setStaffBelongDepartmentName(one.getBelongDepartmentName());
welcomeSuitRang.setSelectType(1);
return welcomeSuitRang;
}).collect(Collectors.toList());
// TODO: 2022/2/11 批量新增
}
@Override
public void deleteSuitDepartment(String welcomeId, String wxEnterpriseId, List<WelcomeSuitDepartmentBO> suitDepartmentList) {
if (CollectionUtils.isEmpty(suitDepartmentList)) {
return;
}
Set<String> welcomeSuitDepartmentIdSet = suitDepartmentList.stream()
.map(WelcomeSuitDepartmentBO::getDepartmentId).collect(Collectors.toSet());
// TODO: 2022/2/11 批量删除
}
@Override
public void deleteSuitStaff(String welcomeId, String wxEnterpriseId, List<WelcomeSuitStaffBO> suitStaffList) {
if (CollectionUtils.isEmpty(suitStaffList)) {
return;
}
Set<String> welcomeSuitDepartmentIdSet = suitStaffList.stream()
.map(WelcomeSuitStaffBO::getStaffId).collect(Collectors.toSet());
// TODO: 2022/2/11 批量删除
}
}
...@@ -526,7 +526,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -526,7 +526,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.info("不发送好办欢迎语,用企微欢迎语:wxEnterpriseId:{}", wxEnterpriseId); log.info("不发送好办欢迎语,用企微欢迎语:wxEnterpriseId:{}", wxEnterpriseId);
return; return;
} }
WelcomeDetailBO welcomeDetailBO = welcomeService.getMatchWelcomeByDept(staffId, wxEnterpriseId); WelcomeDetailBO welcomeDetailBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId);
if (null == welcomeDetailBO || welcomeDetailBO.getOpenFlag() == 0) { if (null == welcomeDetailBO || welcomeDetailBO.getOpenFlag() == 0) {
log.info("欢迎语未配置:wxEnterpriseId:{}", wxEnterpriseId); log.info("欢迎语未配置:wxEnterpriseId:{}", wxEnterpriseId);
return; return;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanFriendSettingMapper"> <mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanFriendSettingMapper">
<resultMap type="com.gic.haoban.manage.service.entity.TabHaobanFriendSetting" id="TabHaobanFriendSettingMap"> <resultMap type="com.gic.haoban.manage.service.entity.TabHaobanFriendSetting" id="TabHaobanFriendSettingMap">
<result property="friendSettingId" column="friend_setting_id" jdbcType="INTEGER"/> <result property="friendSettingId" column="friend_setting_id" jdbcType="BIGINT"/>
<result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/> <result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/>
<result property="friendSettingType" column="friend_setting_type" jdbcType="INTEGER"/> <result property="friendSettingType" column="friend_setting_type" jdbcType="INTEGER"/>
<result property="updateId" column="update_id" jdbcType="VARCHAR"/> <result property="updateId" column="update_id" jdbcType="VARCHAR"/>
...@@ -162,5 +162,10 @@ ...@@ -162,5 +162,10 @@
from tab_haoban_friend_setting from tab_haoban_friend_setting
limit #{offset}, #{limit} limit #{offset}, #{limit}
</select> </select>
<select id="getByWxEnterpriseId" resultType="com.gic.haoban.manage.service.entity.TabHaobanFriendSetting">
select
<include refid="Base_Column_List"/>
from tab_haoban_friend_setting where wx_enterprise_id = #{wxEnterpriseId} and delete_flag = 0
</select>
</mapper> </mapper>
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
<result column="open_flag" jdbcType="INTEGER" property="openFlag"/> <result column="open_flag" jdbcType="INTEGER" property="openFlag"/>
<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="suit_staff" jdbcType="VARCHAR" property="suitStaff"/>
<result column="suit_department" jdbcType="VARCHAR" property="suitDepartment"/>
<result column="operator_id" jdbcType="VARCHAR" property="operatorId"/> <result column="operator_id" jdbcType="VARCHAR" property="operatorId"/>
<result column="operator_name" jdbcType="VARCHAR" property="operatorName"/> <result column="operator_name" jdbcType="VARCHAR" property="operatorName"/>
</resultMap> </resultMap>
...@@ -20,7 +18,7 @@ ...@@ -20,7 +18,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
welcome_id welcome_id
, wx_enterprise_id, title, welcome_content,welcome_img,open_flag, status_flag, , wx_enterprise_id, title, welcome_content,welcome_img,open_flag, status_flag,
create_time, update_time, suit_department, suit_staff, operator_id, operator_name create_time, update_time, operator_id, operator_name
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
...@@ -39,7 +37,7 @@ ...@@ -39,7 +37,7 @@
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabWelcome"> <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabWelcome">
insert into tab_haoban_welcome (welcome_id, wx_enterprise_id, title, insert into tab_haoban_welcome (welcome_id, wx_enterprise_id, title,
welcome_content, welcome_img, open_flag, status_flag, create_time, welcome_content, welcome_img, open_flag, status_flag, create_time,
update_time, suit_department, suit_staff, operator_id, operator_name) update_time, operator_id, operator_name)
values (#{welcomeId,jdbcType=VARCHAR}, values (#{welcomeId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{title,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
...@@ -49,8 +47,6 @@ ...@@ -49,8 +47,6 @@
#{statusFlag,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{suitDepartment,jdbcType=VARCHAR},
#{suitStaff,jdbcType=VARCHAR},
#{operatorId,jdbcType=VARCHAR}, #{operatorId,jdbcType=VARCHAR},
#{operatorName,jdbcType=VARCHAR}) #{operatorName,jdbcType=VARCHAR})
</insert> </insert>
...@@ -82,12 +78,6 @@ ...@@ -82,12 +78,6 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="suitDepartment != null">
suit_department = #{suitDepartment,jdbcType=TIMESTAMP},
</if>
<if test="suitStaff != null">
suit_staff = #{suitStaff,jdbcType=TIMESTAMP},
</if>
<if test="operatorId != null"> <if test="operatorId != null">
operator_id = #{operatorId,jdbcType=TIMESTAMP}, operator_id = #{operatorId,jdbcType=TIMESTAMP},
</if> </if>
...@@ -106,11 +96,14 @@ ...@@ -106,11 +96,14 @@
and status_flag=1 and status_flag=1
</select> </select>
<select id="listByWxEnterpriseId" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="listByWxEnterpriseId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_welcome from tab_haoban_welcome
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
<if test="title != null and title != ''">
title = #{title,jdbcType=VARCHAR},
</if>
and status_flag=1 and status_flag=1
</select> </select>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMediaMapper"> <mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMediaMapper">
<resultMap type="com.gic.haoban.manage.service.entity.TabHaobanWelcomeMedia" id="TabHaobanWelcomeMediaMap"> <resultMap type="com.gic.haoban.manage.service.entity.TabHaobanWelcomeMedia" id="TabHaobanWelcomeMediaMap">
<result property="welcomeMediaId" column="welcome_media_id" jdbcType="INTEGER"/> <result property="welcomeMediaId" column="welcome_media_id" jdbcType="BIGINT"/>
<result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/> <result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/>
<result property="welcomeId" column="welcome_id" jdbcType="VARCHAR"/> <result property="welcomeId" column="welcome_id" jdbcType="VARCHAR"/>
<result property="mediaTitle" column="media_title" jdbcType="VARCHAR"/> <result property="mediaTitle" column="media_title" jdbcType="VARCHAR"/>
...@@ -16,60 +16,39 @@ ...@@ -16,60 +16,39 @@
<!--查询单个--> <!--查询单个-->
<select id="queryById" resultMap="TabHaobanWelcomeMediaMap"> <select id="queryById" resultMap="TabHaobanWelcomeMediaMap">
select select welcome_media_id,
welcome_media_id, wx_enterprise_id, welcome_id, media_title, media_type, media_url, create_time, update_time, delete_flag wx_enterprise_id,
welcome_id,
media_title,
media_type,
media_url,
create_time,
update_time,
delete_flag
from haoban3.tab_haoban_welcome_media from haoban3.tab_haoban_welcome_media
where welcome_media_id = #{welcomeMediaId} where welcome_media_id = #{welcomeMediaId}
</select> </select>
<!--查询指定行数据--> <select id="listByWelcomeId" resultType="com.gic.haoban.manage.service.entity.TabHaobanWelcomeMedia">
<select id="queryAllByLimit" resultMap="TabHaobanWelcomeMediaMap"> select welcome_media_id,
select wx_enterprise_id,
welcome_media_id, wx_enterprise_id, welcome_id, media_title, media_type, media_url, create_time, update_time, delete_flag welcome_id,
from haoban3.tab_haoban_welcome_media media_title,
limit #{offset}, #{limit} media_type,
</select> media_url,
create_time,
<!--通过实体作为筛选条件查询--> update_time,
<select id="queryAll" resultMap="TabHaobanWelcomeMediaMap"> delete_flag
select from tab_haoban_welcome_media
welcome_media_id, wx_enterprise_id, welcome_id, media_title, media_type, media_url, create_time, update_time, delete_flag where welcome_media_id = #{welcomeMediaId} and delete_flag = 0
from haoban3.tab_haoban_welcome_media
<where>
<if test="welcomeMediaId != null">
and welcome_media_id = #{welcomeMediaId}
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="welcomeId != null and welcomeId != ''">
and welcome_id = #{welcomeId}
</if>
<if test="mediaTitle != null">
and media_title = #{mediaTitle}
</if>
<if test="mediaType != null">
and media_type = #{mediaType}
</if>
<if test="mediaUrl != null and mediaUrl != ''">
and media_url = #{mediaUrl}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="deleteFlag != null">
and delete_flag = #{deleteFlag}
</if>
</where>
</select> </select>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="welcomeMediaId" useGeneratedKeys="true"> <insert id="insert" keyProperty="welcomeMediaId" useGeneratedKeys="true">
insert into haoban3.tab_haoban_welcome_media(wx_enterprise_id, welcome_id, media_title, media_type, media_url, create_time, update_time, delete_flag) insert into haoban3.tab_haoban_welcome_media(wx_enterprise_id, welcome_id, media_title, media_type, media_url,
values (#{wxEnterpriseId}, #{welcomeId}, #{mediaTitle}, #{mediaType}, #{mediaUrl}, #{createTime}, #{updateTime}, #{deleteFlag}) create_time, update_time, delete_flag)
values (#{wxEnterpriseId}, #{welcomeId}, #{mediaTitle}, #{mediaType}, #{mediaUrl}, #{createTime}, #{updateTime},
#{deleteFlag})
</insert> </insert>
<!--通过主键修改数据--> <!--通过主键修改数据-->
...@@ -104,9 +83,10 @@ ...@@ -104,9 +83,10 @@
where welcome_media_id = #{welcomeMediaId} where welcome_media_id = #{welcomeMediaId}
</update> </update>
<!--通过主键删除--> <update id="removeByWelcomeId">
<delete id="deleteById"> update tab_haoban_welcome_media
delete from haoban3.tab_haoban_welcome_media where welcome_media_id = #{welcomeMediaId} set delete_flag = 1
</delete> where welcome_id = #{welcomeId}
</update>
</mapper> </mapper>
<?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.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeSuitRangMapper">
<resultMap type="com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang" id="TabHaobanWelcomeSuitRangMap">
<result property="welcomeSuitRangId" column="welcome_suit_rang_id" jdbcType="BIGINT"/>
<result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/>
<result property="welcomeId" column="welcome_id" jdbcType="VARCHAR"/>
<result property="suitType" column="suit_type" jdbcType="INTEGER"/>
<result property="suitDepartmentId" column="suit_department_id" jdbcType="VARCHAR"/>
<result property="suitDepartmentName" column="suit_department_name" jdbcType="VARCHAR"/>
<result property="suitStaffId" column="suit_staff_id" jdbcType="VARCHAR"/>
<result property="suitStaffName" column="suit_staff_name" jdbcType="VARCHAR"/>
<result property="staffBelongDepartmentId" column="staff_belong_department_id" jdbcType="VARCHAR"/>
<result property="staffBelongDepartmentName" column="staff_belong_department_name" jdbcType="VARCHAR"/>
<result property="selectType" column="select_type" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="deleteFlag" column="delete_flag" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="TabHaobanWelcomeSuitRangMap">
select welcome_suit_rang_id,
wx_enterprise_id,
welcome_id,
suit_type,
suit_department_id,
suit_department_name,
suit_staff_id,
suit_staff_name,
staff_belong_department_id,
staff_belong_department_name,
select_type,
create_time,
update_time,
delete_flag
from haoban3.tab_haoban_welcome_suit_rang
where welcome_suit_rang_id = #{welcomeSuitRangId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TabHaobanWelcomeSuitRangMap">
select welcome_suit_rang_id,
wx_enterprise_id,
welcome_id,
suit_type,
suit_department_id,
suit_department_name,
suit_staff_id,
suit_staff_name,
staff_belong_department_id,
staff_belong_department_name,
select_type,
create_time,
update_time,
delete_flag
from haoban3.tab_haoban_welcome_suit_rang limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TabHaobanWelcomeSuitRangMap">
select
welcome_suit_rang_id, wx_enterprise_id, welcome_id, suit_type, suit_department_id, suit_department_name,
suit_staff_id, suit_staff_name, staff_belong_department_id, staff_belong_department_name, select_type, create_time,
update_time, delete_flag
from haoban3.tab_haoban_welcome_suit_rang
<where>
<if test="welcomeSuitRangId != null">
and welcome_suit_rang_id = #{welcomeSuitRangId}
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="welcomeId != null and welcomeId != ''">
and welcome_id = #{welcomeId}
</if>
<if test="suitType != null">
and suit_type = #{suitType}
</if>
<if test="suitDepartmentId != null and suitDepartmentId != ''">
and suit_department_id = #{suitDepartmentId}
</if>
<if test="suitDepartmentName != null and suitDepartmentName != ''">
and suit_department_name = #{suitDepartmentName}
</if>
<if test="suitStaffId != null and suitStaffId != ''">
and suit_staff_id = #{suitStaffId}
</if>
<if test="suitStaffName != null and suitStaffName != ''">
and suit_staff_name = #{suitStaffName}
</if>
<if test="staffBelongDepartmentId != null and staffBelongDepartmentId != ''">
and staff_belong_department_id = #{staffBelongDepartmentId}
</if>
<if test="staffBelongDepartmentName != null and staffBelongDepartmentName != ''">
and staff_belong_department_name = #{staffBelongDepartmentName}
</if>
<if test="selectType != null">
and select_type = #{selectType}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="deleteFlag != null">
and delete_flag = #{deleteFlag}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="welcomeSuitRangId" useGeneratedKeys="true">
insert into haoban3.tab_haoban_welcome_suit_rang(wx_enterprise_id, welcome_id, suit_type, suit_department_id,
suit_department_name, suit_staff_id, suit_staff_name,
staff_belong_department_id, staff_belong_department_name, select_type,
create_time, update_time, delete_flag)
values (#{wxEnterpriseId}, #{welcomeId}, #{suitType}, #{suitDepartmentId}, #{suitDepartmentName},
#{suitStaffId}, #{suitStaffName}, #{staffBelongDepartmentId}, #{staffBelongDepartmentName}, #{selectType}
#{createTime}, #{updateTime}, #{deleteFlag})
</insert>
<!--通过主键修改数据-->
<update id="update">
update haoban3.tab_haoban_welcome_suit_rang
<set>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
wx_enterprise_id = #{wxEnterpriseId},
</if>
<if test="welcomeId != null and welcomeId != ''">
welcome_id = #{welcomeId},
</if>
<if test="suitType != null">
suit_type = #{suitType},
</if>
<if test="suitDepartmentId != null and suitDepartmentId != ''">
suit_department_id = #{suitDepartmentId},
</if>
<if test="suitDepartmentName != null and suitDepartmentName != ''">
suit_department_name = #{suitDepartmentName},
</if>
<if test="suitStaffId != null and suitStaffId != ''">
suit_staff_id = #{suitStaffId},
</if>
<if test="suitStaffName != null and suitStaffName != ''">
suit_staff_name = #{suitStaffName},
</if>
<if test="staffBelongDepartmentId != null and staffBelongDepartmentId != ''">
staff_belong_department_id = #{staffBelongDepartmentId},
</if>
<if test="staffBelongDepartmentName != null and staffBelongDepartmentName != ''">
staff_belong_department_name = #{staffBelongDepartmentName},
</if>
<if test="selectType != null">
select_type = #{selectType},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag},
</if>
</set>
where welcome_suit_rang_id = #{welcomeSuitRangId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from haoban3.tab_haoban_welcome_suit_rang
where welcome_suit_rang_id = #{welcomeSuitRangId}
</delete>
</mapper>
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