diff --git a/datav-manager/src/main/java/com/mortals/xhx/base/system/user/dao/UserPwdRecordDao.java b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/dao/UserPwdRecordDao.java new file mode 100644 index 0000000000000000000000000000000000000000..62a226b65fee0671bc5cc48ac0b1a6e7b6990566 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/dao/UserPwdRecordDao.java @@ -0,0 +1,17 @@ +package com.mortals.xhx.base.system.user.dao; + +import com.mortals.framework.dao.ICRUDDao; +import com.mortals.xhx.base.system.user.model.UserPwdRecordEntity; + +/** +* 鐢ㄦ埛瀵嗙爜淇敼璁板綍Dao +* 鐢ㄦ埛瀵嗙爜淇敼璁板綍 DAO鎺ュ彛 +* +* @author zxfei +* @date 2023-07-26 +*/ + +public interface UserPwdRecordDao extends ICRUDDao<UserPwdRecordEntity,Long>{ + + +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/base/system/user/dao/ibatis/UserPwdRecordDaoImpl.java b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/dao/ibatis/UserPwdRecordDaoImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..b04ad9e12db59bc3d5bb265e6c0a1e244ba47676 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/dao/ibatis/UserPwdRecordDaoImpl.java @@ -0,0 +1,19 @@ +package com.mortals.xhx.base.system.user.dao.ibatis; + + +import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; +import com.mortals.xhx.base.system.user.dao.UserPwdRecordDao; +import com.mortals.xhx.base.system.user.model.UserPwdRecordEntity; +import org.springframework.stereotype.Repository; + +/** +* 鐢ㄦ埛瀵嗙爜淇敼璁板綍DaoImpl DAO鎺ュ彛 +* +* @author zxfei +* @date 2023-07-26 +*/ +@Repository("userPwdRecordDao") +public class UserPwdRecordDaoImpl extends BaseCRUDDaoMybatis<UserPwdRecordEntity,Long> implements UserPwdRecordDao { + + +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/UserPwdRecordEntity.java b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/UserPwdRecordEntity.java new file mode 100644 index 0000000000000000000000000000000000000000..85a2153eb64e44d0776c4dbc846ae7a913ba12d9 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/UserPwdRecordEntity.java @@ -0,0 +1,51 @@ +package com.mortals.xhx.base.system.user.model; +import com.mortals.xhx.base.system.user.model.vo.UserPwdRecordVo; +import lombok.Data; + +/** +* 鐢ㄦ埛瀵嗙爜淇敼璁板綍瀹炰綋瀵硅薄 +* +* @author zxfei +* @date 2023-07-26 +*/ +@Data +public class UserPwdRecordEntity extends UserPwdRecordVo { + private static final long serialVersionUID = 1L; + + /** + * 鐢ㄦ埛ID锛屼富閿紝鑷闀� + */ + private Long userId; + /** + * 鐧诲綍鍚� + */ + private String loginName; + /** + * 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + */ + private String loginPwd; + @Override + public int hashCode() { + return this.getId().hashCode(); + } + @Override + public boolean equals(Object obj) { + if (obj == null) return false; + if (obj instanceof UserPwdRecordEntity) { + UserPwdRecordEntity tmp = (UserPwdRecordEntity) obj; + if (this.getId() == tmp.getId()) { + return true; + } + } + return false; + } + + public void initAttrValue(){ + + this.userId = -1L; + + this.loginName = ""; + + this.loginPwd = ""; + } +} \ No newline at end of file diff --git a/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/UserPwdRecordQuery.java b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/UserPwdRecordQuery.java new file mode 100644 index 0000000000000000000000000000000000000000..c8bee86c3ec0d270f9d7d7e96b04d4419f1e3a7f --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/UserPwdRecordQuery.java @@ -0,0 +1,652 @@ +package com.mortals.xhx.base.system.user.model; + +import java.util.List; +/** + * 鐢ㄦ埛瀵嗙爜淇敼璁板綍鏌ヨ瀵硅薄 + * + * @author zxfei + * @date 2023-07-26 + */ +public class UserPwdRecordQuery extends UserPwdRecordEntity { + /** 寮€濮� 涓婚敭锛岃嚜澧為暱 */ + private Long idStart; + + /** 缁撴潫 涓婚敭锛岃嚜澧為暱 */ + private Long idEnd; + + /** 澧炲姞 涓婚敭锛岃嚜澧為暱 */ + private Long idIncrement; + + /** 涓婚敭锛岃嚜澧為暱鍒楄〃 */ + private List <Long> idList; + + /** 涓婚敭锛岃嚜澧為暱鎺掗櫎鍒楄〃 */ + private List <Long> idNotList; + + /** 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� */ + private Long userIdStart; + + /** 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� */ + private Long userIdEnd; + + /** 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� */ + private Long userIdIncrement; + + /** 鐢ㄦ埛ID锛屼富閿紝鑷闀垮垪琛� */ + private List <Long> userIdList; + + /** 鐢ㄦ埛ID锛屼富閿紝鑷闀挎帓闄ゅ垪琛� */ + private List <Long> userIdNotList; + + /** 鐧诲綍鍚� */ + private List<String> loginNameList; + + /** 鐧诲綍鍚嶆帓闄ゅ垪琛� */ + private List <String> loginNameNotList; + /** 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 */ + private List<String> loginPwdList; + + /** 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑鎺掗櫎鍒楄〃 */ + private List <String> loginPwdNotList; + /** 寮€濮� 鍒涘缓鏃堕棿 */ + private String createTimeStart; + + /** 缁撴潫 鍒涘缓鏃堕棿 */ + private String createTimeEnd; + + /** 寮€濮� 鍒涘缓鐢ㄦ埛 */ + private Long createUserIdStart; + + /** 缁撴潫 鍒涘缓鐢ㄦ埛 */ + private Long createUserIdEnd; + + /** 澧炲姞 鍒涘缓鐢ㄦ埛 */ + private Long createUserIdIncrement; + + /** 鍒涘缓鐢ㄦ埛鍒楄〃 */ + private List <Long> createUserIdList; + + /** 鍒涘缓鐢ㄦ埛鎺掗櫎鍒楄〃 */ + private List <Long> createUserIdNotList; + + /** OR鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疧R锛岄」鍐呭涔嬮棿鏄疉ND锛屽锛�(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ + private List<UserPwdRecordQuery> orConditionList; + + /** AND鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疉ND锛岄」鍐呭涔嬮棿鏄疧R锛屽锛�(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */ + private List<UserPwdRecordQuery> andConditionList; + + public UserPwdRecordQuery(){} + + /** + * 鑾峰彇 寮€濮� 涓婚敭锛岃嚜澧為暱 + * @return idStart + */ + public Long getIdStart(){ + return this.idStart; + } + + /** + * 璁剧疆 寮€濮� 涓婚敭锛岃嚜澧為暱 + * @param idStart + */ + public void setIdStart(Long idStart){ + this.idStart = idStart; + } + + /** + * 鑾峰彇 缁撴潫 涓婚敭锛岃嚜澧為暱 + * @return $idEnd + */ + public Long getIdEnd(){ + return this.idEnd; + } + + /** + * 璁剧疆 缁撴潫 涓婚敭锛岃嚜澧為暱 + * @param idEnd + */ + public void setIdEnd(Long idEnd){ + this.idEnd = idEnd; + } + + /** + * 鑾峰彇 澧炲姞 涓婚敭锛岃嚜澧為暱 + * @return idIncrement + */ + public Long getIdIncrement(){ + return this.idIncrement; + } + + /** + * 璁剧疆 澧炲姞 涓婚敭锛岃嚜澧為暱 + * @param idIncrement + */ + public void setIdIncrement(Long idIncrement){ + this.idIncrement = idIncrement; + } + + /** + * 鑾峰彇 涓婚敭锛岃嚜澧為暱 + * @return idList + */ + public List<Long> getIdList(){ + return this.idList; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idList + */ + public void setIdList(List<Long> idList){ + this.idList = idList; + } + + /** + * 鑾峰彇 涓婚敭锛岃嚜澧為暱 + * @return idNotList + */ + public List<Long> getIdNotList(){ + return this.idNotList; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idNotList + */ + public void setIdNotList(List<Long> idNotList){ + this.idNotList = idNotList; + } + + + /** + * 鑾峰彇 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdStart + */ + public Long getUserIdStart(){ + return this.userIdStart; + } + + /** + * 璁剧疆 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdStart + */ + public void setUserIdStart(Long userIdStart){ + this.userIdStart = userIdStart; + } + + /** + * 鑾峰彇 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return $userIdEnd + */ + public Long getUserIdEnd(){ + return this.userIdEnd; + } + + /** + * 璁剧疆 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdEnd + */ + public void setUserIdEnd(Long userIdEnd){ + this.userIdEnd = userIdEnd; + } + + /** + * 鑾峰彇 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdIncrement + */ + public Long getUserIdIncrement(){ + return this.userIdIncrement; + } + + /** + * 璁剧疆 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdIncrement + */ + public void setUserIdIncrement(Long userIdIncrement){ + this.userIdIncrement = userIdIncrement; + } + + /** + * 鑾峰彇 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdList + */ + public List<Long> getUserIdList(){ + return this.userIdList; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdList + */ + public void setUserIdList(List<Long> userIdList){ + this.userIdList = userIdList; + } + + /** + * 鑾峰彇 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdNotList + */ + public List<Long> getUserIdNotList(){ + return this.userIdNotList; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdNotList + */ + public void setUserIdNotList(List<Long> userIdNotList){ + this.userIdNotList = userIdNotList; + } + + + /** + * 鑾峰彇 鐧诲綍鍚� + * @return loginNameList + */ + public List<String> getLoginNameList(){ + return this.loginNameList; + } + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginNameList + */ + public void setLoginNameList(List<String> loginNameList){ + this.loginNameList = loginNameList; + } + + /** + * 鑾峰彇 鐧诲綍鍚� + * @return loginNameNotList + */ + public List<String> getLoginNameNotList(){ + return this.loginNameNotList; + } + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginNameNotList + */ + public void setLoginNameNotList(List<String> loginNameNotList){ + this.loginNameNotList = loginNameNotList; + } + + /** + * 鑾峰彇 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @return loginPwdList + */ + public List<String> getLoginPwdList(){ + return this.loginPwdList; + } + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwdList + */ + public void setLoginPwdList(List<String> loginPwdList){ + this.loginPwdList = loginPwdList; + } + + /** + * 鑾峰彇 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @return loginPwdNotList + */ + public List<String> getLoginPwdNotList(){ + return this.loginPwdNotList; + } + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwdNotList + */ + public void setLoginPwdNotList(List<String> loginPwdNotList){ + this.loginPwdNotList = loginPwdNotList; + } + + /** + * 鑾峰彇 寮€濮� 鍒涘缓鏃堕棿 + * @return createTimeStart + */ + public String getCreateTimeStart(){ + return this.createTimeStart; + } + + /** + * 璁剧疆 寮€濮� 鍒涘缓鏃堕棿 + * @param createTimeStart + */ + public void setCreateTimeStart(String createTimeStart){ + this.createTimeStart = createTimeStart; + } + + /** + * 鑾峰彇 缁撴潫 鍒涘缓鏃堕棿 + * @return createTimeEnd + */ + public String getCreateTimeEnd(){ + return this.createTimeEnd; + } + + /** + * 璁剧疆 缁撴潫 鍒涘缓鏃堕棿 + * @param createTimeEnd + */ + public void setCreateTimeEnd(String createTimeEnd){ + this.createTimeEnd = createTimeEnd; + } + + /** + * 鑾峰彇 寮€濮� 鍒涘缓鐢ㄦ埛 + * @return createUserIdStart + */ + public Long getCreateUserIdStart(){ + return this.createUserIdStart; + } + + /** + * 璁剧疆 寮€濮� 鍒涘缓鐢ㄦ埛 + * @param createUserIdStart + */ + public void setCreateUserIdStart(Long createUserIdStart){ + this.createUserIdStart = createUserIdStart; + } + + /** + * 鑾峰彇 缁撴潫 鍒涘缓鐢ㄦ埛 + * @return $createUserIdEnd + */ + public Long getCreateUserIdEnd(){ + return this.createUserIdEnd; + } + + /** + * 璁剧疆 缁撴潫 鍒涘缓鐢ㄦ埛 + * @param createUserIdEnd + */ + public void setCreateUserIdEnd(Long createUserIdEnd){ + this.createUserIdEnd = createUserIdEnd; + } + + /** + * 鑾峰彇 澧炲姞 鍒涘缓鐢ㄦ埛 + * @return createUserIdIncrement + */ + public Long getCreateUserIdIncrement(){ + return this.createUserIdIncrement; + } + + /** + * 璁剧疆 澧炲姞 鍒涘缓鐢ㄦ埛 + * @param createUserIdIncrement + */ + public void setCreateUserIdIncrement(Long createUserIdIncrement){ + this.createUserIdIncrement = createUserIdIncrement; + } + + /** + * 鑾峰彇 鍒涘缓鐢ㄦ埛 + * @return createUserIdList + */ + public List<Long> getCreateUserIdList(){ + return this.createUserIdList; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdList + */ + public void setCreateUserIdList(List<Long> createUserIdList){ + this.createUserIdList = createUserIdList; + } + + /** + * 鑾峰彇 鍒涘缓鐢ㄦ埛 + * @return createUserIdNotList + */ + public List<Long> getCreateUserIdNotList(){ + return this.createUserIdNotList; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdNotList + */ + public void setCreateUserIdNotList(List<Long> createUserIdNotList){ + this.createUserIdNotList = createUserIdNotList; + } + + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param id + */ + public UserPwdRecordQuery id(Long id){ + setId(id); + return this; + } + + /** + * 璁剧疆 寮€濮� 涓婚敭锛岃嚜澧為暱 + * @param idStart + */ + public UserPwdRecordQuery idStart(Long idStart){ + this.idStart = idStart; + return this; + } + + /** + * 璁剧疆 缁撴潫 涓婚敭锛岃嚜澧為暱 + * @param idEnd + */ + public UserPwdRecordQuery idEnd(Long idEnd){ + this.idEnd = idEnd; + return this; + } + + /** + * 璁剧疆 澧炲姞 涓婚敭锛岃嚜澧為暱 + * @param idIncrement + */ + public UserPwdRecordQuery idIncrement(Long idIncrement){ + this.idIncrement = idIncrement; + return this; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idList + */ + public UserPwdRecordQuery idList(List<Long> idList){ + this.idList = idList; + return this; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idNotList + */ + public UserPwdRecordQuery idNotList(List<Long> idNotList){ + this.idNotList = idNotList; + return this; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userId + */ + public UserPwdRecordQuery userId(Long userId){ + setUserId(userId); + return this; + } + + /** + * 璁剧疆 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdStart + */ + public UserPwdRecordQuery userIdStart(Long userIdStart){ + this.userIdStart = userIdStart; + return this; + } + + /** + * 璁剧疆 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdEnd + */ + public UserPwdRecordQuery userIdEnd(Long userIdEnd){ + this.userIdEnd = userIdEnd; + return this; + } + + /** + * 璁剧疆 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdIncrement + */ + public UserPwdRecordQuery userIdIncrement(Long userIdIncrement){ + this.userIdIncrement = userIdIncrement; + return this; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdList + */ + public UserPwdRecordQuery userIdList(List<Long> userIdList){ + this.userIdList = userIdList; + return this; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdNotList + */ + public UserPwdRecordQuery userIdNotList(List<Long> userIdNotList){ + this.userIdNotList = userIdNotList; + return this; + } + + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginName + */ + public UserPwdRecordQuery loginName(String loginName){ + setLoginName(loginName); + return this; + } + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginNameList + */ + public UserPwdRecordQuery loginNameList(List<String> loginNameList){ + this.loginNameList = loginNameList; + return this; + } + + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwd + */ + public UserPwdRecordQuery loginPwd(String loginPwd){ + setLoginPwd(loginPwd); + return this; + } + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwdList + */ + public UserPwdRecordQuery loginPwdList(List<String> loginPwdList){ + this.loginPwdList = loginPwdList; + return this; + } + + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserId + */ + public UserPwdRecordQuery createUserId(Long createUserId){ + setCreateUserId(createUserId); + return this; + } + + /** + * 璁剧疆 寮€濮� 鍒涘缓鐢ㄦ埛 + * @param createUserIdStart + */ + public UserPwdRecordQuery createUserIdStart(Long createUserIdStart){ + this.createUserIdStart = createUserIdStart; + return this; + } + + /** + * 璁剧疆 缁撴潫 鍒涘缓鐢ㄦ埛 + * @param createUserIdEnd + */ + public UserPwdRecordQuery createUserIdEnd(Long createUserIdEnd){ + this.createUserIdEnd = createUserIdEnd; + return this; + } + + /** + * 璁剧疆 澧炲姞 鍒涘缓鐢ㄦ埛 + * @param createUserIdIncrement + */ + public UserPwdRecordQuery createUserIdIncrement(Long createUserIdIncrement){ + this.createUserIdIncrement = createUserIdIncrement; + return this; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdList + */ + public UserPwdRecordQuery createUserIdList(List<Long> createUserIdList){ + this.createUserIdList = createUserIdList; + return this; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdNotList + */ + public UserPwdRecordQuery createUserIdNotList(List<Long> createUserIdNotList){ + this.createUserIdNotList = createUserIdNotList; + return this; + } + + /** + * 鑾峰彇 OR鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疧R锛岄」鍐呭涔嬮棿鏄疉ND锛屽锛�(list[0].1 and list[0].2) or (list[1].3 and list[1].4) + * @return orConditionList + */ + public List<UserPwdRecordQuery> getOrConditionList(){ + return this.orConditionList; + } + + /** + * 璁剧疆 OR鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疧R锛岄」鍐呭涔嬮棿鏄疉ND锛屽锛�(list[0].1 and list[0].2) or (list[1].3 and list[1].4) + * @param orConditionList + */ + public void setOrConditionList(List<UserPwdRecordQuery> orConditionList){ + this.orConditionList = orConditionList; + } + + /** + * 鑾峰彇 AND鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疉ND锛岄」鍐呭涔嬮棿鏄疧R锛屽锛�(list[0].1 or list[0].2) and (list[1].3 or list[1].4) + * @return andConditionList + */ + public List<UserPwdRecordQuery> getAndConditionList(){ + return this.andConditionList; + } + + /** + * 璁剧疆 AND鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疉ND锛岄」鍐呭涔嬮棿鏄疧R锛屽锛�(list[0].1 or list[0].2) and (list[1].3 or list[1].4) + * @param andConditionList + */ + public void setAndConditionList(List<UserPwdRecordQuery> andConditionList){ + this.andConditionList = andConditionList; + } + +} \ No newline at end of file diff --git a/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/vo/UserPwdRecordVo.java b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/vo/UserPwdRecordVo.java new file mode 100644 index 0000000000000000000000000000000000000000..47ba8a708de599545d2d257eccb11ec1b119495e --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/base/system/user/model/vo/UserPwdRecordVo.java @@ -0,0 +1,15 @@ +package com.mortals.xhx.base.system.user.model.vo; + +import com.mortals.framework.model.BaseEntityLong; +import lombok.Data; + +/** +* 鐢ㄦ埛瀵嗙爜淇敼璁板綍瑙嗗浘瀵硅薄 +* +* @author zxfei +* @date 2023-07-26 +*/ +@Data +public class UserPwdRecordVo extends BaseEntityLong { + +} \ No newline at end of file diff --git a/datav-manager/src/main/java/com/mortals/xhx/common/code/DesignTypeEnum.java b/datav-manager/src/main/java/com/mortals/xhx/common/code/DesignTypeEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..8f473ebbf5914e321880e0dbfd357652e82342c7 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/common/code/DesignTypeEnum.java @@ -0,0 +1,71 @@ +package com.mortals.xhx.common.code; + +import com.mortals.framework.ap.SysConstains; +import com.mortals.framework.common.IBaseEnum; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * 璁捐绫诲瀷 + */ +public enum DesignTypeEnum implements IBaseEnum { + + PICTURES(1,"鍥剧墖", SysConstains.STYLE_DEFAULT), + VIDEOS(2,"瑙嗛", SysConstains.STYLE_DEFAULT), + ; + + private int value; + private String desc; + private String style; + + DesignTypeEnum(int value, String desc, String style) { + this.value = value; + this.desc = desc; + this.style = style; + } + + @Override + public int getValue() { + return this.value; + } + + @Override + public String getDesc() { + return this.desc; + } + + @Override + public String getStyle() { + return this.style; + } + + public static DesignTypeEnum getByValue(int value) { + for (DesignTypeEnum e : DesignTypeEnum.values()) { + if (e.getValue() == value) { + return e; + } + } + return null; + } + + public static Map<String,String> getEnumMap(int... eItem) { + Map<String,String> resultMap= new LinkedHashMap<String,String>(); + for (DesignTypeEnum item : DesignTypeEnum.values()) { + try{ + boolean hasE = false; + for (int e : eItem){ + if(item.getValue()==e){ + hasE = true; + break; + } + } + if(!hasE){ + resultMap.put(item.getValue()+"", item.getDesc()); + } + }catch(Exception ex){ + } + } + return resultMap; + } +} \ No newline at end of file diff --git a/datav-manager/src/main/java/com/mortals/xhx/common/utils/LoginAESUtil.java b/datav-manager/src/main/java/com/mortals/xhx/common/utils/LoginAESUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..ddf86ec8162ab71c3e0ee8fefa8199b1373689da --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/common/utils/LoginAESUtil.java @@ -0,0 +1,213 @@ +package com.mortals.xhx.common.utils; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Random; + +public class LoginAESUtil { + /** + * 鍔犲瘑妯″紡涔� ECB锛岀畻娉�/妯″紡/琛ョ爜鏂瑰紡 + */ + public static final String AES_ECB = "AES/ECB/PKCS5Padding"; + + /** + * 鍔犲瘑妯″紡涔� CBC锛岀畻娉�/妯″紡/琛ョ爜鏂瑰紡 + */ + public static final String AES_CBC = "AES/CBC/PKCS5Padding"; + + /** + * 鍔犲瘑妯″紡涔� CFB锛岀畻娉�/妯″紡/琛ョ爜鏂瑰紡 + */ + public static final String AES_CFB = "AES/CFB/PKCS5Padding"; + + /** + * AES 涓殑 IV 蹇呴』鏄� 16 瀛楄妭锛�128浣嶏級闀� + */ + public static final Integer IV_LENGTH = 16; + + /*** + * <h2>绌烘牎楠�</h2> + * @param str 闇€瑕佸垽鏂殑鍊� + */ + public static boolean isEmpty(Object str) { + return null == str || "".equals(str); + } + + /*** + * <h2>String 杞� byte</h2> + * @param str 闇€瑕佽浆鎹㈢殑瀛楃涓� + */ + public static byte[] getBytes(String str) { + if (isEmpty(str)) { + return null; + } + try { + return str.getBytes(StandardCharsets.UTF_8); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /*** + * <h2>鍒濆鍖栧悜閲忥紙IV锛夛紝瀹冩槸涓€涓殢鏈虹敓鎴愮殑瀛楄妭鏁扮粍锛岀敤浜庡鍔犲姞瀵嗗拰瑙e瘑鐨勫畨鍏ㄦ€�</h2> + */ + public static String getIV() { + String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + Random random = new Random(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < IV_LENGTH; i++) { + int number = random.nextInt(str.length()); + sb.append(str.charAt(number)); + } + return sb.toString(); + } + + /*** + * <h2>鑾峰彇涓€涓� AES 瀵嗛挜瑙勮寖</h2> + */ + public static SecretKeySpec getSecretKeySpec(String key) { + SecretKeySpec secretKeySpec = new SecretKeySpec(getBytes(key), "AES"); + return secretKeySpec; + } + + /** + * <h2>鍔犲瘑 - 妯″紡 ECB</h2> + * + * @param text 闇€瑕佸姞瀵嗙殑鏂囨湰鍐呭 + * @param key 鍔犲瘑鐨勫瘑閽� key + */ + public static String encrypt(String text, String key) { + if (isEmpty(text) || isEmpty(key)) { + return null; + } + try { + + // 鍒涘缓AES鍔犲瘑鍣� + Cipher cipher = Cipher.getInstance(AES_ECB); + SecretKeySpec secretKeySpec = getSecretKeySpec(key); + cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); + + // 鍔犲瘑瀛楄妭鏁扮粍 + byte[] encryptedBytes = cipher.doFinal(getBytes(text)); + + // 灏嗗瘑鏂囪浆鎹负 Base64 缂栫爜瀛楃涓� + return Base64.getEncoder().encodeToString(encryptedBytes); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * <h2>瑙e瘑 - 妯″紡 ECB</h2> + * + * @param text 闇€瑕佽В瀵嗙殑鏂囨湰鍐呭 + * @param key 瑙e瘑鐨勫瘑閽� key + */ + public static String decrypt(String text, String key) { + if (isEmpty(text) || isEmpty(key)) { + return null; + } + + // 灏嗗瘑鏂囪浆鎹负16瀛楄妭鐨勫瓧鑺傛暟缁� + byte[] textBytes = Base64.getDecoder().decode(text); + try { + + // 鍒涘缓AES鍔犲瘑鍣� + Cipher cipher = Cipher.getInstance(AES_ECB); + SecretKeySpec secretKeySpec = getSecretKeySpec(key); + cipher.init(Cipher.DECRYPT_MODE, secretKeySpec); + + // 瑙e瘑瀛楄妭鏁扮粍 + byte[] decryptedBytes = cipher.doFinal(textBytes); + + // 灏嗘槑鏂囪浆鎹负瀛楃涓� + return new String(decryptedBytes, StandardCharsets.UTF_8); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * <h2>鍔犲瘑 - 鑷畾涔夊姞瀵嗘ā寮�</h2> + * + * @param text 闇€瑕佸姞瀵嗙殑鏂囨湰鍐呭 + * @param key 鍔犲瘑鐨勫瘑閽� key + * @param iv 鍒濆鍖栧悜閲� + * @param mode 鍔犲瘑妯″紡 + */ + public static String encrypt(String text, String key, String iv, String mode) { + if (isEmpty(text) || isEmpty(key) || isEmpty(iv)) { + return null; + } + try { + + // 鍒涘缓AES鍔犲瘑鍣� + Cipher cipher = Cipher.getInstance(mode); + SecretKeySpec secretKeySpec = getSecretKeySpec(key); + cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, new IvParameterSpec(getBytes(iv))); + + // 鍔犲瘑瀛楄妭鏁扮粍 + byte[] encryptedBytes = cipher.doFinal(getBytes(text)); + + // 灏嗗瘑鏂囪浆鎹负 Base64 缂栫爜瀛楃涓� + return Base64.getEncoder().encodeToString(encryptedBytes); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * <h2>瑙e瘑 - 鑷畾涔夊姞瀵嗘ā寮�</h2> + * + * @param text 闇€瑕佽В瀵嗙殑鏂囨湰鍐呭 + * @param key 瑙e瘑鐨勫瘑閽� key + * @param iv 鍒濆鍖栧悜閲� + * @param mode 鍔犲瘑妯″紡 + */ + public static String decrypt(String text, String key, String iv, String mode) { + if (isEmpty(text) || isEmpty(key) || isEmpty(iv)) { + return null; + } + + // 灏嗗瘑鏂囪浆鎹负16瀛楄妭鐨勫瓧鑺傛暟缁� + byte[] textBytes = Base64.getDecoder().decode(text); + try { + + // 鍒涘缓AES鍔犲瘑鍣� + Cipher cipher = Cipher.getInstance(mode); + SecretKeySpec secretKeySpec = getSecretKeySpec(key); + cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, new IvParameterSpec(getBytes(iv))); + + // 瑙e瘑瀛楄妭鏁扮粍 + byte[] decryptedBytes = cipher.doFinal(textBytes); + + // 灏嗘槑鏂囪浆鎹负瀛楃涓� + return new String(decryptedBytes, StandardCharsets.UTF_8); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static void main(String[] args) { + String text = "Scsmile@2022"; + String key = "0000000671595991"; + // 16瀛楄妭鐨勫瘑閽� + String iv = "tdrdadq59tbss5n7"; + String encryptTextEBC = encrypt(text, key); + System.out.println("EBC 鍔犲瘑鍚庡唴瀹癸細" + encryptTextEBC); + System.out.println("EBC 瑙e瘑鍚庡唴瀹癸細" + decrypt(encryptTextEBC, key)); + System.out.println(); + String encryptTextCBC = encrypt(text, key, iv, AES_CBC); + System.out.println("CBC 鍔犲瘑IV锛�" + iv); + System.out.println("CBC 鍔犲瘑鍚庡唴瀹癸細" + encryptTextCBC); + System.out.println("CBC 瑙e瘑鍚庡唴瀹癸細" + decrypt(encryptTextCBC, key, iv, AES_CBC)); + System.out.println(); + String encryptTextCFB = encrypt(text, key, iv, AES_CFB); + System.out.println("CFB 鍔犲瘑IV锛�" + iv); + System.out.println("CFB 鍔犲瘑鍚庡唴瀹癸細" + encryptTextCFB); + System.out.println("CFB 瑙e瘑鍚庡唴瀹癸細" + decrypt(encryptTextCFB, key, iv, AES_CFB)); + } +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/common/utils/Solution.java b/datav-manager/src/main/java/com/mortals/xhx/common/utils/Solution.java new file mode 100644 index 0000000000000000000000000000000000000000..ff7c9d90f222b0ba071a15c48a21895416f223fb --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/common/utils/Solution.java @@ -0,0 +1,73 @@ +package com.mortals.xhx.common.utils; + + +public class Solution { + //鍒ゆ柇杈撳叆鏄惁涓烘暟瀛� + public static boolean isNumber(char s) { + return s >= '0' && s <= '9'; + } + + //鍒ゆ柇杈撳叆鏄惁涓哄ぇ鍐欏瓧姣� + public static boolean isUpper(char s) { + return s >= 'A' && s <= 'Z'; + } + + //鍒ゆ柇杈撳叆鏄惁涓哄皬鍐欏瓧姣� + public static boolean isLower(char s) { + return s >= 'a' && s <= 'z'; + } + + //鍒ゆ柇杈撳叆鏄惁涓虹壒娈婂瓧绗� + public static boolean isCharacter(char s) { + return (s < 'a' || s > 'z') && (s < 'A' || s > 'Z') && (s < '0' || s > '9'); + } + + //鍒ゆ柇杈撳叆闀垮害鏄惁鍚堟硶 + public static boolean lengthOK(String s, int length) { + return s.length() >= length; + } + + //鍒ゆ柇鏄惁鏈夎繛缁浉鍚岃緭鍏� + public static boolean isSample(char[] arr) { + for (int i = 0; i < arr.length; i++) { + if (i < arr.length - 1 && (arr[i] == arr[i + 1])) { + return false; + } + } + return true; + } + + //鍒ゆ柇瀵嗙爜鏄惁鏄己瀵嗙爜 + public static boolean strongPasswordCheckerII(String password) { + //浠ヤ簲涓猙oolean鍙橀噺璁板綍鏄惁鍖呭惈鍏舵寚瀹氬瓧绗︼紝鑻ュ寘鍚紝灏嗗搴斿€肩疆涓簍rue + boolean isSample = false, isNumber = false, isUpper = false, isLower = false, isCharacter = false; + //棣栧厛鍒ゆ柇闀垮害锛岃嫢闀垮害涓嶇锛宺eturn false + if (lengthOK(password, 8)) { + //灏嗚緭鍏ヨ浆涓烘暟缁勶紝渚夸簬鎿嶄綔 + char[] arr = password.toCharArray(); + //鍒ゆ柇鏄惁鏈夎繛缁浉鍚岃緭鍏ワ紝鑻ユ湁鍒檌sSample=false + isSample = isSample(arr); + for (char c : arr) { + //鍒ゆ柇鏄惁鍖呭惈鏁板瓧锛岃嫢鏈夊垯isNumber=true + if (!isNumber) { + isNumber = isNumber(c); + } + //鍒ゆ柇鏄惁鍖呭惈澶у啓瀛楁瘝锛岃嫢鏈夊垯isUpper=true + if (!isUpper) { + isUpper = isUpper(c); + } + //鍒ゆ柇鏄惁鍖呭惈灏忓啓瀛楁瘝锛岃嫢鏈夊垯isLower=true + if (!isLower) { + isLower = isLower(c); + } + //鍒ゆ柇鏄惁鍖呭惈鐗规畩瀛楃锛岃嫢鏈夊垯isCharacter=true + if (!isCharacter) { + isCharacter = isCharacter(c); + } + } + } + //鑻ユ弧瓒冲己瀵嗙爜鎵€鏈夋潯浠讹紝鍒欒繑鍥瀟rue + return isNumber && isUpper && isLower && isCharacter && isSample; + } +} + diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/dao/CustomerPwdRecordDao.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/dao/CustomerPwdRecordDao.java new file mode 100644 index 0000000000000000000000000000000000000000..4306d2b3a889f93f67f1c7200afff3e26e194268 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/dao/CustomerPwdRecordDao.java @@ -0,0 +1,7 @@ +package com.mortals.xhx.module.customer.dao; + +import com.mortals.framework.dao.ICRUDDao; +import com.mortals.xhx.module.customer.model.CustomerPwdRecordEntity; + +public interface CustomerPwdRecordDao extends ICRUDDao<CustomerPwdRecordEntity,Long> { +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/dao/ibatis/CustomerPwdRecordDaoImpl.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/dao/ibatis/CustomerPwdRecordDaoImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..7dc437c4b9b59083220ee700197a9b665da99950 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/dao/ibatis/CustomerPwdRecordDaoImpl.java @@ -0,0 +1,10 @@ +package com.mortals.xhx.module.customer.dao.ibatis; + +import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; +import com.mortals.xhx.module.customer.dao.CustomerPwdRecordDao; +import com.mortals.xhx.module.customer.model.CustomerPwdRecordEntity; +import org.springframework.stereotype.Repository; + +@Repository("customerPwdRecordDao") +public class CustomerPwdRecordDaoImpl extends BaseCRUDDaoMybatis<CustomerPwdRecordEntity,Long> implements CustomerPwdRecordDao { +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerPwdRecordEntity.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerPwdRecordEntity.java new file mode 100644 index 0000000000000000000000000000000000000000..93d4975a0600134cf2ad27f11416d9a0a7abb642 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerPwdRecordEntity.java @@ -0,0 +1,47 @@ +package com.mortals.xhx.module.customer.model; + +import com.mortals.xhx.base.system.user.model.UserPwdRecordEntity; +import com.mortals.xhx.module.customer.model.vo.CustomerPwdRecordVo; +import lombok.Data; + +@Data +public class CustomerPwdRecordEntity extends CustomerPwdRecordVo { + private static final long serialVersionUID = 1L; + + /** + * 鐢ㄦ埛ID锛屼富閿紝鑷闀� + */ + private Long userId; + /** + * 鐧诲綍鍚� + */ + private String loginName; + /** + * 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + */ + private String loginPwd; + @Override + public int hashCode() { + return this.getId().hashCode(); + } + @Override + public boolean equals(Object obj) { + if (obj == null) return false; + if (obj instanceof CustomerPwdRecordEntity) { + CustomerPwdRecordEntity tmp = (CustomerPwdRecordEntity) obj; + if (this.getId() == tmp.getId()) { + return true; + } + } + return false; + } + + public void initAttrValue(){ + + this.userId = -1L; + + this.loginName = ""; + + this.loginPwd = ""; + } +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerPwdRecordQuery.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerPwdRecordQuery.java new file mode 100644 index 0000000000000000000000000000000000000000..24a62573ef598a51fe94a5f7b32fee2a8cf6b198 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerPwdRecordQuery.java @@ -0,0 +1,648 @@ +package com.mortals.xhx.module.customer.model; + +import com.mortals.xhx.base.system.user.model.UserPwdRecordQuery; + +import java.util.List; + +public class CustomerPwdRecordQuery extends CustomerPwdRecordEntity { + /** 寮€濮� 涓婚敭锛岃嚜澧為暱 */ + private Long idStart; + + /** 缁撴潫 涓婚敭锛岃嚜澧為暱 */ + private Long idEnd; + + /** 澧炲姞 涓婚敭锛岃嚜澧為暱 */ + private Long idIncrement; + + /** 涓婚敭锛岃嚜澧為暱鍒楄〃 */ + private List<Long> idList; + + /** 涓婚敭锛岃嚜澧為暱鎺掗櫎鍒楄〃 */ + private List <Long> idNotList; + + /** 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� */ + private Long userIdStart; + + /** 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� */ + private Long userIdEnd; + + /** 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� */ + private Long userIdIncrement; + + /** 鐢ㄦ埛ID锛屼富閿紝鑷闀垮垪琛� */ + private List <Long> userIdList; + + /** 鐢ㄦ埛ID锛屼富閿紝鑷闀挎帓闄ゅ垪琛� */ + private List <Long> userIdNotList; + + /** 鐧诲綍鍚� */ + private List<String> loginNameList; + + /** 鐧诲綍鍚嶆帓闄ゅ垪琛� */ + private List <String> loginNameNotList; + /** 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 */ + private List<String> loginPwdList; + + /** 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑鎺掗櫎鍒楄〃 */ + private List <String> loginPwdNotList; + /** 寮€濮� 鍒涘缓鏃堕棿 */ + private String createTimeStart; + + /** 缁撴潫 鍒涘缓鏃堕棿 */ + private String createTimeEnd; + + /** 寮€濮� 鍒涘缓鐢ㄦ埛 */ + private Long createUserIdStart; + + /** 缁撴潫 鍒涘缓鐢ㄦ埛 */ + private Long createUserIdEnd; + + /** 澧炲姞 鍒涘缓鐢ㄦ埛 */ + private Long createUserIdIncrement; + + /** 鍒涘缓鐢ㄦ埛鍒楄〃 */ + private List <Long> createUserIdList; + + /** 鍒涘缓鐢ㄦ埛鎺掗櫎鍒楄〃 */ + private List <Long> createUserIdNotList; + + /** OR鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疧R锛岄」鍐呭涔嬮棿鏄疉ND锛屽锛�(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ + private List<CustomerPwdRecordQuery> orConditionList; + + /** AND鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疉ND锛岄」鍐呭涔嬮棿鏄疧R锛屽锛�(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */ + private List<CustomerPwdRecordQuery> andConditionList; + + public CustomerPwdRecordQuery(){} + + /** + * 鑾峰彇 寮€濮� 涓婚敭锛岃嚜澧為暱 + * @return idStart + */ + public Long getIdStart(){ + return this.idStart; + } + + /** + * 璁剧疆 寮€濮� 涓婚敭锛岃嚜澧為暱 + * @param idStart + */ + public void setIdStart(Long idStart){ + this.idStart = idStart; + } + + /** + * 鑾峰彇 缁撴潫 涓婚敭锛岃嚜澧為暱 + * @return $idEnd + */ + public Long getIdEnd(){ + return this.idEnd; + } + + /** + * 璁剧疆 缁撴潫 涓婚敭锛岃嚜澧為暱 + * @param idEnd + */ + public void setIdEnd(Long idEnd){ + this.idEnd = idEnd; + } + + /** + * 鑾峰彇 澧炲姞 涓婚敭锛岃嚜澧為暱 + * @return idIncrement + */ + public Long getIdIncrement(){ + return this.idIncrement; + } + + /** + * 璁剧疆 澧炲姞 涓婚敭锛岃嚜澧為暱 + * @param idIncrement + */ + public void setIdIncrement(Long idIncrement){ + this.idIncrement = idIncrement; + } + + /** + * 鑾峰彇 涓婚敭锛岃嚜澧為暱 + * @return idList + */ + public List<Long> getIdList(){ + return this.idList; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idList + */ + public void setIdList(List<Long> idList){ + this.idList = idList; + } + + /** + * 鑾峰彇 涓婚敭锛岃嚜澧為暱 + * @return idNotList + */ + public List<Long> getIdNotList(){ + return this.idNotList; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idNotList + */ + public void setIdNotList(List<Long> idNotList){ + this.idNotList = idNotList; + } + + + /** + * 鑾峰彇 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdStart + */ + public Long getUserIdStart(){ + return this.userIdStart; + } + + /** + * 璁剧疆 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdStart + */ + public void setUserIdStart(Long userIdStart){ + this.userIdStart = userIdStart; + } + + /** + * 鑾峰彇 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return $userIdEnd + */ + public Long getUserIdEnd(){ + return this.userIdEnd; + } + + /** + * 璁剧疆 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdEnd + */ + public void setUserIdEnd(Long userIdEnd){ + this.userIdEnd = userIdEnd; + } + + /** + * 鑾峰彇 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdIncrement + */ + public Long getUserIdIncrement(){ + return this.userIdIncrement; + } + + /** + * 璁剧疆 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdIncrement + */ + public void setUserIdIncrement(Long userIdIncrement){ + this.userIdIncrement = userIdIncrement; + } + + /** + * 鑾峰彇 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdList + */ + public List<Long> getUserIdList(){ + return this.userIdList; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdList + */ + public void setUserIdList(List<Long> userIdList){ + this.userIdList = userIdList; + } + + /** + * 鑾峰彇 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @return userIdNotList + */ + public List<Long> getUserIdNotList(){ + return this.userIdNotList; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdNotList + */ + public void setUserIdNotList(List<Long> userIdNotList){ + this.userIdNotList = userIdNotList; + } + + + /** + * 鑾峰彇 鐧诲綍鍚� + * @return loginNameList + */ + public List<String> getLoginNameList(){ + return this.loginNameList; + } + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginNameList + */ + public void setLoginNameList(List<String> loginNameList){ + this.loginNameList = loginNameList; + } + + /** + * 鑾峰彇 鐧诲綍鍚� + * @return loginNameNotList + */ + public List<String> getLoginNameNotList(){ + return this.loginNameNotList; + } + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginNameNotList + */ + public void setLoginNameNotList(List<String> loginNameNotList){ + this.loginNameNotList = loginNameNotList; + } + + /** + * 鑾峰彇 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @return loginPwdList + */ + public List<String> getLoginPwdList(){ + return this.loginPwdList; + } + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwdList + */ + public void setLoginPwdList(List<String> loginPwdList){ + this.loginPwdList = loginPwdList; + } + + /** + * 鑾峰彇 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @return loginPwdNotList + */ + public List<String> getLoginPwdNotList(){ + return this.loginPwdNotList; + } + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwdNotList + */ + public void setLoginPwdNotList(List<String> loginPwdNotList){ + this.loginPwdNotList = loginPwdNotList; + } + + /** + * 鑾峰彇 寮€濮� 鍒涘缓鏃堕棿 + * @return createTimeStart + */ + public String getCreateTimeStart(){ + return this.createTimeStart; + } + + /** + * 璁剧疆 寮€濮� 鍒涘缓鏃堕棿 + * @param createTimeStart + */ + public void setCreateTimeStart(String createTimeStart){ + this.createTimeStart = createTimeStart; + } + + /** + * 鑾峰彇 缁撴潫 鍒涘缓鏃堕棿 + * @return createTimeEnd + */ + public String getCreateTimeEnd(){ + return this.createTimeEnd; + } + + /** + * 璁剧疆 缁撴潫 鍒涘缓鏃堕棿 + * @param createTimeEnd + */ + public void setCreateTimeEnd(String createTimeEnd){ + this.createTimeEnd = createTimeEnd; + } + + /** + * 鑾峰彇 寮€濮� 鍒涘缓鐢ㄦ埛 + * @return createUserIdStart + */ + public Long getCreateUserIdStart(){ + return this.createUserIdStart; + } + + /** + * 璁剧疆 寮€濮� 鍒涘缓鐢ㄦ埛 + * @param createUserIdStart + */ + public void setCreateUserIdStart(Long createUserIdStart){ + this.createUserIdStart = createUserIdStart; + } + + /** + * 鑾峰彇 缁撴潫 鍒涘缓鐢ㄦ埛 + * @return $createUserIdEnd + */ + public Long getCreateUserIdEnd(){ + return this.createUserIdEnd; + } + + /** + * 璁剧疆 缁撴潫 鍒涘缓鐢ㄦ埛 + * @param createUserIdEnd + */ + public void setCreateUserIdEnd(Long createUserIdEnd){ + this.createUserIdEnd = createUserIdEnd; + } + + /** + * 鑾峰彇 澧炲姞 鍒涘缓鐢ㄦ埛 + * @return createUserIdIncrement + */ + public Long getCreateUserIdIncrement(){ + return this.createUserIdIncrement; + } + + /** + * 璁剧疆 澧炲姞 鍒涘缓鐢ㄦ埛 + * @param createUserIdIncrement + */ + public void setCreateUserIdIncrement(Long createUserIdIncrement){ + this.createUserIdIncrement = createUserIdIncrement; + } + + /** + * 鑾峰彇 鍒涘缓鐢ㄦ埛 + * @return createUserIdList + */ + public List<Long> getCreateUserIdList(){ + return this.createUserIdList; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdList + */ + public void setCreateUserIdList(List<Long> createUserIdList){ + this.createUserIdList = createUserIdList; + } + + /** + * 鑾峰彇 鍒涘缓鐢ㄦ埛 + * @return createUserIdNotList + */ + public List<Long> getCreateUserIdNotList(){ + return this.createUserIdNotList; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdNotList + */ + public void setCreateUserIdNotList(List<Long> createUserIdNotList){ + this.createUserIdNotList = createUserIdNotList; + } + + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param id + */ + public CustomerPwdRecordQuery id(Long id){ + setId(id); + return this; + } + + /** + * 璁剧疆 寮€濮� 涓婚敭锛岃嚜澧為暱 + * @param idStart + */ + public CustomerPwdRecordQuery idStart(Long idStart){ + this.idStart = idStart; + return this; + } + + /** + * 璁剧疆 缁撴潫 涓婚敭锛岃嚜澧為暱 + * @param idEnd + */ + public CustomerPwdRecordQuery idEnd(Long idEnd){ + this.idEnd = idEnd; + return this; + } + + /** + * 璁剧疆 澧炲姞 涓婚敭锛岃嚜澧為暱 + * @param idIncrement + */ + public CustomerPwdRecordQuery idIncrement(Long idIncrement){ + this.idIncrement = idIncrement; + return this; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idList + */ + public CustomerPwdRecordQuery idList(List<Long> idList){ + this.idList = idList; + return this; + } + + /** + * 璁剧疆 涓婚敭锛岃嚜澧為暱 + * @param idNotList + */ + public CustomerPwdRecordQuery idNotList(List<Long> idNotList){ + this.idNotList = idNotList; + return this; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userId + */ + public CustomerPwdRecordQuery userId(Long userId){ + setUserId(userId); + return this; + } + + /** + * 璁剧疆 寮€濮� 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdStart + */ + public CustomerPwdRecordQuery userIdStart(Long userIdStart){ + this.userIdStart = userIdStart; + return this; + } + + /** + * 璁剧疆 缁撴潫 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdEnd + */ + public CustomerPwdRecordQuery userIdEnd(Long userIdEnd){ + this.userIdEnd = userIdEnd; + return this; + } + + /** + * 璁剧疆 澧炲姞 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdIncrement + */ + public CustomerPwdRecordQuery userIdIncrement(Long userIdIncrement){ + this.userIdIncrement = userIdIncrement; + return this; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdList + */ + public CustomerPwdRecordQuery userIdList(List<Long> userIdList){ + this.userIdList = userIdList; + return this; + } + + /** + * 璁剧疆 鐢ㄦ埛ID锛屼富閿紝鑷闀� + * @param userIdNotList + */ + public CustomerPwdRecordQuery userIdNotList(List<Long> userIdNotList){ + this.userIdNotList = userIdNotList; + return this; + } + + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginName + */ + public CustomerPwdRecordQuery loginName(String loginName){ + setLoginName(loginName); + return this; + } + + /** + * 璁剧疆 鐧诲綍鍚� + * @param loginNameList + */ + public CustomerPwdRecordQuery loginNameList(List<String> loginNameList){ + this.loginNameList = loginNameList; + return this; + } + + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwd + */ + public CustomerPwdRecordQuery loginPwd(String loginPwd){ + setLoginPwd(loginPwd); + return this; + } + + /** + * 璁剧疆 鐧诲綍瀵嗙爜锛屼娇鐢╩d5鍙屾鍔犲瘑 + * @param loginPwdList + */ + public CustomerPwdRecordQuery loginPwdList(List<String> loginPwdList){ + this.loginPwdList = loginPwdList; + return this; + } + + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserId + */ + public CustomerPwdRecordQuery createUserId(Long createUserId){ + setCreateUserId(createUserId); + return this; + } + + /** + * 璁剧疆 寮€濮� 鍒涘缓鐢ㄦ埛 + * @param createUserIdStart + */ + public CustomerPwdRecordQuery createUserIdStart(Long createUserIdStart){ + this.createUserIdStart = createUserIdStart; + return this; + } + + /** + * 璁剧疆 缁撴潫 鍒涘缓鐢ㄦ埛 + * @param createUserIdEnd + */ + public CustomerPwdRecordQuery createUserIdEnd(Long createUserIdEnd){ + this.createUserIdEnd = createUserIdEnd; + return this; + } + + /** + * 璁剧疆 澧炲姞 鍒涘缓鐢ㄦ埛 + * @param createUserIdIncrement + */ + public CustomerPwdRecordQuery createUserIdIncrement(Long createUserIdIncrement){ + this.createUserIdIncrement = createUserIdIncrement; + return this; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdList + */ + public CustomerPwdRecordQuery createUserIdList(List<Long> createUserIdList){ + this.createUserIdList = createUserIdList; + return this; + } + + /** + * 璁剧疆 鍒涘缓鐢ㄦ埛 + * @param createUserIdNotList + */ + public CustomerPwdRecordQuery createUserIdNotList(List<Long> createUserIdNotList){ + this.createUserIdNotList = createUserIdNotList; + return this; + } + + /** + * 鑾峰彇 OR鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疧R锛岄」鍐呭涔嬮棿鏄疉ND锛屽锛�(list[0].1 and list[0].2) or (list[1].3 and list[1].4) + * @return orConditionList + */ + public List<CustomerPwdRecordQuery> getOrConditionList(){ + return this.orConditionList; + } + + /** + * 璁剧疆 OR鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疧R锛岄」鍐呭涔嬮棿鏄疉ND锛屽锛�(list[0].1 and list[0].2) or (list[1].3 and list[1].4) + * @param orConditionList + */ + public void setOrConditionList(List<CustomerPwdRecordQuery> orConditionList){ + this.orConditionList = orConditionList; + } + + /** + * 鑾峰彇 AND鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疉ND锛岄」鍐呭涔嬮棿鏄疧R锛屽锛�(list[0].1 or list[0].2) and (list[1].3 or list[1].4) + * @return andConditionList + */ + public List<CustomerPwdRecordQuery> getAndConditionList(){ + return this.andConditionList; + } + + /** + * 璁剧疆 AND鏉′欢闆嗗悎锛屽垪琛ㄩ」涔嬮棿鏄疉ND锛岄」鍐呭涔嬮棿鏄疧R锛屽锛�(list[0].1 or list[0].2) and (list[1].3 or list[1].4) + * @param andConditionList + */ + public void setAndConditionList(List<CustomerPwdRecordQuery> andConditionList){ + this.andConditionList = andConditionList; + } +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerCensusVo.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerCensusVo.java new file mode 100644 index 0000000000000000000000000000000000000000..9b39cb196c5e657021a9203e1695495262dc03ea --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerCensusVo.java @@ -0,0 +1,16 @@ +package com.mortals.xhx.module.customer.model.vo; + +import lombok.Data; + +/** + * 鐢ㄦ埛鍒嗙被缁熻 + */ +@Data +public class CustomerCensusVo { + /** + * 浼氬憳绛夌骇锛岋紝0锛氭湭寮€鍚紝1锛氳瘯鐢ㄥ鎴凤紝2锛歏IP锛�3锛氳璁″笀锛岄粯璁�0 + */ + private Integer memberLevel; + /** 缁熻缁撴灉 **/ + private Integer customerCount; +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerDesignCensusVo.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerDesignCensusVo.java new file mode 100644 index 0000000000000000000000000000000000000000..abca18573ecb99efc4d221606e7d6ade75bef8c5 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerDesignCensusVo.java @@ -0,0 +1,14 @@ +package com.mortals.xhx.module.customer.model.vo; + +import lombok.Data; + +/** + * 鐢ㄦ埛浣滃搧缁熻 + */ +@Data +public class CustomerDesignCensusVo { + /** 鍥剧墖鏁� **/ + private Integer picturesCount; + /** 瑙嗛鏁� **/ + private Integer videosCount; +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerPwdRecordVo.java b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerPwdRecordVo.java new file mode 100644 index 0000000000000000000000000000000000000000..c9cb81bed5880048ddb5f4ac71bf901a7b6b3b4f --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerPwdRecordVo.java @@ -0,0 +1,6 @@ +package com.mortals.xhx.module.customer.model.vo; + +import com.mortals.framework.model.BaseEntityLong; + +public class CustomerPwdRecordVo extends BaseEntityLong { +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/sms/SMSLoginController.java b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/sms/SMSLoginController.java new file mode 100644 index 0000000000000000000000000000000000000000..57c8a91d4dc1dfe696116cc7961e4ceba6b73c29 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/sms/SMSLoginController.java @@ -0,0 +1,89 @@ +package com.mortals.xhx.module.thirdlog.sms; + +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSONObject; +import com.mortals.framework.annotation.UnAuth; +import com.mortals.framework.common.Rest; +import com.mortals.framework.model.Context; +import com.mortals.framework.service.IAuthTokenService; +import com.mortals.framework.service.ICacheService; +import com.mortals.framework.util.DateUtils; +import com.mortals.framework.util.StringUtils; +import com.mortals.framework.web.BaseJsonBodyController; +import com.mortals.xhx.base.login.web.LoginForm; +import com.mortals.xhx.module.customer.model.CustomerEntity; +import com.mortals.xhx.module.customer.service.CustomerService; +import com.mortals.xhx.module.thirdlog.sms.pdu.SMSLoginPdu; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("sms") +public class SMSLoginController extends BaseJsonBodyController { + + @Autowired + private CustomerService customerService; + @Autowired + private IAuthTokenService authTokenService; + + @PostMapping({"send"}) + @UnAuth + public Rest<Object> sendSmsVerifyCode(@RequestBody SMSLoginPdu smsLoginPdu){ + Rest<Object> ret = new Rest(); + Map<String, Object> model = new HashMap(); + Context context = this.getContext(); + String busiDesc = "鍙戦€佹墜鏈洪獙璇佺爜"; + + int code=1; + try { + customerService.sendSmsVerifyCode(smsLoginPdu.getMobileNumber()); + model.put("message_info", busiDesc + "鎴愬姛"); + this.recordSysLog(this.request, busiDesc + " 銆愭垚鍔熴€�"); + } catch (Exception var9) { + code = -1; + this.doException(this.request, busiDesc, model, var9); + } + + ret.setCode(code); + ret.setData(model); + ret.setDict(model.get("dict")); + ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString()); + return ret; + } + + @PostMapping("login") + @UnAuth + public String login(@RequestBody SMSLoginPdu smsLoginPdu) throws Exception { + JSONObject ret = new JSONObject(); + Map<String, Object> data = new HashMap<>(); + String ip = super.getRequestIP(request); + CustomerEntity customerEntity = null; + try { + customerEntity = customerService.doSmsLogin(smsLoginPdu.getMobileNumber(), smsLoginPdu.getVerifyCode(), ip); + customerEntity.setLastLoginAddress(ip); + customerEntity.setLoginTime(System.currentTimeMillis()); + customerEntity.setToken(IdUtil.fastSimpleUUID()); + customerEntity.setExpireTime(DateUtils.addCurrDate(7).getTime()); + String token = authTokenService.createToken(customerEntity); + data.put("token", token); + data.put("customer", customerEntity); + recordSysLog(request, customerEntity, "瀹㈡埛鐧诲綍绯荤粺鎴愬姛!"); + ret.put(KEY_RESULT_DATA, data); + ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); + ret.put(KEY_RESULT_MSG, "鐢ㄦ埛鐧诲綍绯荤粺鎴愬姛!"); + return ret.toJSONString(); + } catch (Exception e) { + log.error("login error ", e); + ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); + ret.put(KEY_RESULT_MSG, super.convertException(e)); + return ret.toJSONString(); + } + } +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/sms/pdu/SMSLoginPdu.java b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/sms/pdu/SMSLoginPdu.java new file mode 100644 index 0000000000000000000000000000000000000000..da74b06d1d8d0e54a95a86899fc440294949fa1f --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/sms/pdu/SMSLoginPdu.java @@ -0,0 +1,11 @@ +package com.mortals.xhx.module.thirdlog.sms.pdu; + +import lombok.Data; + +@Data +public class SMSLoginPdu { + /** 鎵嬫満鍙风爜 */ + private String mobileNumber; + /** 楠岃瘉鐮� */ + private String verifyCode; +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/WeChatLoginController.java b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/WeChatLoginController.java new file mode 100644 index 0000000000000000000000000000000000000000..26a8b5a110aa50d6fb5a7c2f68d8dfadeed94247 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/WeChatLoginController.java @@ -0,0 +1,168 @@ +package com.mortals.xhx.module.thirdlog.wechat; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; +import com.alibaba.fastjson.JSONObject; +import com.mortals.framework.annotation.UnAuth; +import com.mortals.framework.common.Rest; +import com.mortals.framework.exception.AppException; +import com.mortals.framework.model.Context; +import com.mortals.framework.service.ICacheService; +import com.mortals.framework.util.DateUtils; +import com.mortals.framework.web.BaseJsonBodyController; +import com.mortals.xhx.common.utils.StringUtils; +import com.mortals.xhx.module.customer.model.CustomerEntity; +import com.mortals.xhx.module.customer.service.CustomerService; +import com.mortals.xhx.module.thirdlog.sms.pdu.SMSLoginPdu; +import com.mortals.xhx.module.thirdlog.wechat.utils.WeChatUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +/** + * 寰俊鎵爜鐧诲綍 + */ +@RestController +@RequestMapping("wechat") +public class WeChatLoginController extends BaseJsonBodyController { + + @Autowired + private CustomerService customerService; + @Autowired + private ICacheService cacheService; + + private static String WX_VERIFY_CODE_KEY ="login:wx:verify:"; + + /** + * 寰俊appId + */ + @Value("${WeChat.pc.appID:wx55400ca31cbbe7fb}") + private String APP_ID; + + /** + * 寰俊appSecret + */ + @Value("${WeChat.pc.appSecret:22555d29a9f914bac0400af5cf63d6b3}") + private String APP_SECRET; + + @RequestMapping( + value = {"getLoginSoleCode"}, + method = {RequestMethod.POST, RequestMethod.GET} + ) + @UnAuth + public Rest<Object> sendSmsVerifyCode(){ + Rest<Object> ret = new Rest(); + Map<String, Object> model = new HashMap(); + String busiDesc = "鑾峰彇寰俊鐧诲綍楠岃瘉鐮�"; + int code=1; + try { + String vCode = RandomUtil.randomNumbers(11); + cacheService.setnx(WX_VERIFY_CODE_KEY+vCode,vCode,90); + model.put("data",vCode); + model.put("message_info", busiDesc + "鎴愬姛"); + } catch (Exception var9) { + code = -1; + this.doException(this.request, busiDesc, model, var9); + } + ret.setCode(code); + ret.setData(model.get("data")); + ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString()); + return ret; + } + + + @RequestMapping( + value = {"wxLoginOAuth"}, + method = {RequestMethod.POST, RequestMethod.GET} + ) + @UnAuth + public String wxLoginOAuth(HttpServletRequest request, HttpServletResponse response){ + JSONObject ret = new JSONObject(); + Map<String, Object> data = new HashMap<>(); + try { + // 绗笁鏂瑰彂璧峰井淇℃巿鏉冪櫥褰曡姹傦紝寰俊鐢ㄦ埛鍏佽鎺堟潈绗笁鏂瑰簲鐢ㄥ悗锛屽井淇′細鎷夎捣搴旂敤鎴栭噸瀹氬悜鍒扮涓夋柟缃戠珯锛屽苟涓斿甫涓婃巿鏉冧复鏃剁エ鎹甤ode鍙傛暟锛� + String loginCode = request.getParameter("code"); + //鍓嶇鎵爜鐧诲叆浼犳潵鐨勬椂闂存埑 + String loginState = request.getParameter("state"); + //鐢ㄦ埛鎷掔粷鎺堟潈鏃禼ode涓虹┖锛屽井淇′篃涓嶄細璇锋眰璇ユ帴鍙c€備负浜嗛槻姝㈤潪娉曡姹傦紝鑻ode涓虹┖鍒欒繑鍥� + if (StringUtils.isEmpty(loginCode)) { + throw new AppException("鐧诲叆璇锋眰琚嫆缁�"); + } + if (StringUtils.isEmpty(loginState)) { + throw new AppException("璇锋眰鐘舵€佸紓甯�"); + } + String vCode = cacheService.get(WX_VERIFY_CODE_KEY + loginState); + if (StringUtils.isEmpty(vCode)){ + throw new AppException("寰俊鐧诲綍楠岃瘉鐮佸け鏁�"); + } + Map<String,String> accessTokenMap = WeChatUtils.getAccessToken(loginCode,APP_ID,APP_SECRET); + String access_token = accessTokenMap.get("access_token");//鎺ュ彛璋冪敤鍑瘉锛岀櫥褰曞悗鍙充笂瑙掑睍绀烘暟鎹渶瑕佽鍊煎幓鑾峰彇 + String openid = accessTokenMap.get("openid");//鎺堟潈鐢ㄦ埛鍞竴鏍囪瘑 + String ip = super.getRequestIP(request); + CustomerEntity customerEntity = customerService.doWeChatLogin(openid,ip); + customerEntity.setLastLoginAddress(ip); + customerEntity.setLoginTime(System.currentTimeMillis()); + customerEntity.setToken(IdUtil.fastSimpleUUID()); + customerEntity.setExpireTime(DateUtils.addCurrDate(7).getTime()); + String token = authTokenService.createToken(customerEntity); + data.put("token", token); + data.put("customer", customerEntity); + recordSysLog(request, customerEntity, "瀹㈡埛鎵爜鐧诲綍绯荤粺鎴愬姛!"); + ret.put(KEY_RESULT_DATA, data); + ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); + ret.put(KEY_RESULT_MSG, "鐢ㄦ埛鐧诲綍绯荤粺鎴愬姛!"); + return ret.toJSONString(); + } catch (Exception e) { + log.error("login error ", e); + ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); + ret.put(KEY_RESULT_MSG, super.convertException(e)); + return ret.toJSONString(); + } + } + + @RequestMapping( + value = {"bind"}, + method = {RequestMethod.POST, RequestMethod.GET} + ) + @UnAuth + public String bind(HttpServletRequest request, HttpServletResponse response){ + JSONObject ret = new JSONObject(); + Map<String, Object> data = new HashMap<>(); + try { + // 绗笁鏂瑰彂璧峰井淇℃巿鏉冪櫥褰曡姹傦紝寰俊鐢ㄦ埛鍏佽鎺堟潈绗笁鏂瑰簲鐢ㄥ悗锛屽井淇′細鎷夎捣搴旂敤鎴栭噸瀹氬悜鍒扮涓夋柟缃戠珯锛屽苟涓斿甫涓婃巿鏉冧复鏃剁エ鎹甤ode鍙傛暟锛� + String loginCode = request.getParameter("code"); + //鍓嶇鎵爜鐧诲叆浼犳潵鐨勬椂闂存埑 + String loginState = request.getParameter("state"); + //鐢ㄦ埛鎷掔粷鎺堟潈鏃禼ode涓虹┖锛屽井淇′篃涓嶄細璇锋眰璇ユ帴鍙c€備负浜嗛槻姝㈤潪娉曡姹傦紝鑻ode涓虹┖鍒欒繑鍥� + if (StringUtils.isEmpty(loginCode)) { + throw new AppException("鐧诲叆璇锋眰琚嫆缁�"); + } + if (StringUtils.isEmpty(loginState)) { + throw new AppException("璇锋眰鐘舵€佸紓甯�"); + } + String vCode = cacheService.get(WX_VERIFY_CODE_KEY + loginState); + if (StringUtils.isEmpty(vCode)){ + throw new AppException("寰俊鐧诲綍楠岃瘉鐮佸け鏁�"); + } + Map<String,String> accessTokenMap = WeChatUtils.getAccessToken(loginCode,APP_ID,APP_SECRET); + String access_token = accessTokenMap.get("access_token");//鎺ュ彛璋冪敤鍑瘉锛岀櫥褰曞悗鍙充笂瑙掑睍绀烘暟鎹渶瑕佽鍊煎幓鑾峰彇 + String openid = accessTokenMap.get("openid");//鎺堟潈鐢ㄦ埛鍞竴鏍囪瘑 + data.put("openId", openid); + ret.put(KEY_RESULT_DATA, data); + ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); + ret.put(KEY_RESULT_MSG, "寰俊鎵爜鎴愬姛!"); + return ret.toJSONString(); + } catch (Exception e) { + log.error("bind error ", e); + ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); + ret.put(KEY_RESULT_MSG, super.convertException(e)); + return ret.toJSONString(); + } + } + +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/utils/JsonUtils.java b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/utils/JsonUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..aad97110a613bef9564307372b2f549f3bd8bd20 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/utils/JsonUtils.java @@ -0,0 +1,76 @@ +package com.mortals.xhx.module.thirdlog.wechat.utils; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * description: json宸ュ叿绫� <br> + * version: 1.0 <br> + * @date: 2019/7/20 0019 涓婂崍 10:17 <br> + * @author: William <br> + */ +public class JsonUtils { + + public static final ObjectMapper MAPPER = new ObjectMapper(); + + private static final Logger logger = LoggerFactory.getLogger(JsonUtils.class); + + public static String serialize(Object obj) { + if (obj == null) { + return null; + } + if (obj.getClass() == String.class) { + return (String) obj; + } + try { + return MAPPER.writeValueAsString(obj); + } catch (JsonProcessingException e) { + logger.error("json搴忓垪鍖栧嚭閿欙細" + obj, e); + return null; + } + } + + public static <T> T parse(String json, Class<T> tClass) { + try { + return MAPPER.readValue(json, tClass); + } catch (IOException e) { + logger.error("json瑙f瀽鍑洪敊锛�" + json, e); + return null; + } + } + + public static <E> List<E> parseList(String json, Class<E> eClass) { + try { + return MAPPER.readValue(json, MAPPER.getTypeFactory().constructCollectionType(List.class, eClass)); + } catch (IOException e) { + logger.error("json瑙f瀽鍑洪敊锛�" + json, e); + return null; + } + } + + public static <K, V> Map<K, V> parseMap(String json, Class<K> kClass, Class<V> vClass) { + try { + return MAPPER.readValue(json, MAPPER.getTypeFactory().constructMapType(Map.class, kClass, vClass)); + } catch (IOException e) { + logger.error("json瑙f瀽鍑洪敊锛�" + json, e); + return null; + } + } + + public static <T> T nativeRead(String json, TypeReference<T> type) { + try { + return MAPPER.readValue(json, type); + } catch (IOException e) { + logger.error("json瑙f瀽鍑洪敊锛�" + json, e); + return null; + } + } + +} diff --git a/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/utils/WeChatUtils.java b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/utils/WeChatUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..6780faaaa2e9f4f2783fb4f1051b431009910942 --- /dev/null +++ b/datav-manager/src/main/java/com/mortals/xhx/module/thirdlog/wechat/utils/WeChatUtils.java @@ -0,0 +1,91 @@ +package com.mortals.xhx.module.thirdlog.wechat.utils; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import org.springframework.beans.factory.annotation.Value; + +import java.util.Map; + +/** + * description: WeChatUtils 寰俊鑾峰彇鐢ㄦ埛宸ュ叿绫�<br> + * + * @date: 2021/8/19 0019 涓婂崍 10:05 <br> + * @author: William <br> + * version: 1.0 <br> + */ +public class WeChatUtils { + + /** + * 鑾峰彇寰俊accessToken璺緞 + */ + private static final String GET_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code"; + + /** + * 寰俊appId + */ + @Value("${WeChat.pc.appID:wx55400ca31cbbe7fb}") + private static String APP_ID; + + /** + * 寰俊appSecret + */ + @Value("${WeChat.pc.appSecret:22555d29a9f914bac0400af5cf63d6b3}") + private static String APP_SECRET; + + + /** + * description: getAccessToken 鏍规嵁code鑾峰彇accessToken<br> + * version: 1.0 <br> + * @date: 2021/8/19 0019 涓婂崍 10:10 <br> + * @author: William <br> + * @param code 寰俊鐢ㄦ埛鎺堟潈code + * @return java.util.Map<java.lang.String,java.lang.String> + */ + public static Map<String,String> getAccessToken(String code){ + return getAccessToken(code,APP_ID,APP_SECRET); + } + + /** + * description: getAccessToken 鏍规嵁code鑾峰彇寰俊鐢ㄦ埛淇℃伅锛岃繑鍥瀖ap濡傛灉姝g‘map鍖呭惈access_token ,濡傛灉閿欒鍒欏寘鍚細errcode<br> + * version: 1.0 <br> + * @date: 2021/8/19 0019 涓婂崍 10:11 <br> + * @author: William <br> + * @param code 寰俊鎺堟潈code + * @param appId 寰俊appId + * @param appSecret 寰俊appSecret + * @return java.util.Map<java.lang.String,java.lang.String> + */ + public static Map<String,String> getAccessToken(String code,String appId,String appSecret){ + //鍒ゆ柇鎵€鏈夊瓧娈典笉鑳戒负绌� + if(isAnyBlank(code,appId,appSecret)){ + throw new IllegalArgumentException("鍙傛暟閿欒"); + } + String requestUrl = GET_ACCESS_TOKEN_URL.replace("APPID",appId) + .replace("SECRET",appSecret).replace("CODE",code); + String result = HttpUtil.get(requestUrl); + return JsonUtils.parseMap(result, String.class, String.class); + } + + /** + * description: isAnyBlank 鍒ゆ柇鏄惁瀛樺湪绌哄瓧绗︿覆锛孒utool鏈紪鍐�<br> + * version: 1.0 <br> + * @date: 2021/8/19 0019 涓婂崍 10:25 <br> + * @author: William <br> + * @param strs 瀛楃涓� + * @return java.lang.Boolean + */ + public static Boolean isAnyBlank(CharSequence... strs){ + //濡傛灉涓虹┖鐩存帴杩斿洖true + if (ArrayUtil.isEmpty(strs)) { + return true; + } + for (CharSequence str : strs) { + if (StrUtil.isBlank(str)) { + return true; + } + } + return false; + } + +} diff --git a/datav-manager/src/main/resources/sqlmap/base/system/UserPwdRecordMapper.xml b/datav-manager/src/main/resources/sqlmap/base/system/UserPwdRecordMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..24be232ad23fd89d51d8ed4a89f59fca2af13ccf --- /dev/null +++ b/datav-manager/src/main/resources/sqlmap/base/system/UserPwdRecordMapper.xml @@ -0,0 +1,453 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"mybatis-3-mapper.dtd"> +<mapper namespace="com.mortals.xhx.base.system.user.dao.ibatis.UserPwdRecordDaoImpl"> + + <!-- 瀛楁鍜屽睘鎬ф槧灏� --> + <resultMap type="UserPwdRecordEntity" id="UserPwdRecordEntity-Map"> + <id property="id" column="id" /> + <result property="userId" column="userId" /> + <result property="loginName" column="loginName" /> + <result property="loginPwd" column="loginPwd" /> + <result property="createTime" column="createTime" /> + <result property="createUserId" column="createUserId" /> + + </resultMap> + + + <!-- 琛ㄦ墍鏈夊垪 --> + <sql id="_columns"> + <trim suffixOverrides="," suffix=""> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))"> + a.id, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('userId') or colPickMode == 1 and data.containsKey('userId')))"> + a.userId, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('loginName') or colPickMode == 1 and data.containsKey('loginName')))"> + a.loginName, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('loginPwd') or colPickMode == 1 and data.containsKey('loginPwd')))"> + a.loginPwd, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))"> + a.createTime, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))"> + a.createUserId, + </if> + </trim> + </sql> + <!-- 鏂板 鍖哄垎涓婚敭鑷鍔犺繕鏄笟鍔℃彃鍏� --> + <insert id="insert" parameterType="UserPwdRecordEntity" useGeneratedKeys="true" keyProperty="id"> + insert into mortals_xhx_user_pwd_record + (userId,loginName,loginPwd,createTime,createUserId) + VALUES + (#{userId},#{loginName},#{loginPwd},#{createTime},#{createUserId}) + </insert> + + <!-- 鎵归噺鏂板 --> + <insert id="insertBatch" parameterType="paramDto"> + insert into mortals_xhx_user_pwd_record + (userId,loginName,loginPwd,createTime,createUserId) + VALUES + <foreach collection="data.dataList" item="item" index="index" separator="," > + (#{item.userId},#{item.loginName},#{item.loginPwd},#{item.createTime},#{item.createUserId}) + </foreach> + </insert> + + + <!-- 鏍规嵁ParamDto鏇存柊 --> + <update id="update" parameterType="paramDto"> + update mortals_xhx_user_pwd_record as a + set + <trim suffixOverrides="," suffix=""> + <if test="(colPickMode==0 and data.containsKey('userId')) or (colPickMode==1 and !data.containsKey('userId'))"> + a.userId=#{data.userId}, + </if> + <if test="(colPickMode==0 and data.containsKey('userIdIncrement')) or (colPickMode==1 and !data.containsKey('userIdIncrement'))"> + a.userId=ifnull(a.userId,0) + #{data.userIdIncrement}, + </if> + <if test="(colPickMode==0 and data.containsKey('loginName')) or (colPickMode==1 and !data.containsKey('loginName'))"> + a.loginName=#{data.loginName}, + </if> + <if test="(colPickMode==0 and data.containsKey('loginPwd')) or (colPickMode==1 and !data.containsKey('loginPwd'))"> + a.loginPwd=#{data.loginPwd}, + </if> + <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))"> + a.createTime=#{data.createTime}, + </if> + <if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))"> + a.createUserId=#{data.createUserId}, + </if> + <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))"> + a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement}, + </if> + </trim> + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + </update> + <!-- 鎵归噺鏇存柊 --> + <update id="updateBatch" parameterType="paramDto"> + update mortals_xhx_user_pwd_record as a + <trim prefix="set" suffixOverrides=","> + <trim prefix="userId=(case" suffix="ELSE userId end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <choose> + <when test="(colPickMode==0 and item.containsKey('userId')) or (colPickMode==1 and !item.containsKey('userId'))"> + when a.id=#{item.id} then #{item.userId} + </when> + <when test="(colPickMode==0 and item.containsKey('userIdIncrement')) or (colPickMode==1 and !item.containsKey('userIdIncrement'))"> + when a.id=#{item.id} then ifnull(a.userId,0) + #{item.userIdIncrement} + </when> + </choose> + </foreach> + </trim> + <trim prefix="loginName=(case" suffix="ELSE loginName end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <if test="(colPickMode==0 and item.containsKey('loginName')) or (colPickMode==1 and !item.containsKey('loginName'))"> + when a.id=#{item.id} then #{item.loginName} + </if> + </foreach> + </trim> + <trim prefix="loginPwd=(case" suffix="ELSE loginPwd end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <if test="(colPickMode==0 and item.containsKey('loginPwd')) or (colPickMode==1 and !item.containsKey('loginPwd'))"> + when a.id=#{item.id} then #{item.loginPwd} + </if> + </foreach> + </trim> + <trim prefix="createTime=(case" suffix="ELSE createTime end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))"> + when a.id=#{item.id} then #{item.createTime} + </if> + </foreach> + </trim> + <trim prefix="createUserId=(case" suffix="ELSE createUserId end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <choose> + <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))"> + when a.id=#{item.id} then #{item.createUserId} + </when> + <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))"> + when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement} + </when> + </choose> + </foreach> + </trim> + </trim> + where id in + <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> + #{item.id} + </foreach> + </update> + <!-- 鏍规嵁涓诲仴鏌ヨ --> + <select id="getByKey" parameterType="paramDto" resultMap="UserPwdRecordEntity-Map"> + select <include refid="_columns"/> + from mortals_xhx_user_pwd_record as a + where a.id=#{condition.id} + </select> + <!-- 鏍规嵁涓诲仴鍒犻櫎 --> + <delete id="deleteByKey" parameterType="paramDto"> + delete a.* from mortals_xhx_user_pwd_record as a where a.id=#{condition.id} + </delete> + <!-- 鏍规嵁涓诲仴鍒犻櫎涓€鎵癸紝閽堝鍗曚竴涓诲仴鏈夋晥 --> + <delete id="deleteByKeys"> + delete from mortals_xhx_user_pwd_record where id in + <foreach collection="array" item="item" index="index" open="(" separator="," close=")"> + #{item} + </foreach> + </delete> + <!-- 鏍规嵁涓诲仴鍒楄〃鍒犻櫎涓€鎵癸紝閽堝鍗曚竴涓诲仴鏈夋晥 --> + <delete id="deleteByKeyList"> + delete from mortals_xhx_user_pwd_record where id in + <foreach collection="list" item="item" index="index" open="(" separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 鏍规嵁瀵硅薄鍒楄〃鍒犻櫎涓€鎵癸紝閽堝鍗曚竴涓诲仴鏈夋晥 --> + <delete id="deleteByEntityList"> + delete from mortals_xhx_user_pwd_record where id in + <foreach collection="list" item="item" index="index" open="(" separator="," close=")"> + #{item.id} + </foreach> + </delete> + <!-- 鏍规嵁paramDto鍒犻櫎涓€鎵� --> + <delete id="deleteByMap" parameterType="paramDto"> + delete a.* from mortals_xhx_user_pwd_record as a + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + </delete> + <!-- 鑾峰彇鍒楄〃 --> + <select id="getList" parameterType="paramDto" resultMap="UserPwdRecordEntity-Map"> + select <include refid="_columns"/> + from mortals_xhx_user_pwd_record as a + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + <include refid="_orderCols_"/> + </select> + + + + <!-- 鑾峰彇 --> + <select id="getListCount" parameterType="paramDto" resultType="int"> + select count(1) + from mortals_xhx_user_pwd_record as a + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + </select> + <!-- 鏉′欢鏄犲皠 --> + <sql id="_condition_"> + <if test="condition != null and !condition.isEmpty()"> + <!-- 鏉′欢鏄犲皠-鏅€氭潯浠� --> + <include refid="_condition_param_"> + <property name="_conditionParam_" value="condition"/> + <property name="_conditionType_" value="and"/> + </include> + <!-- 鏉′欢鏄犲皠-闆嗗悎涔嬮棿浣跨敤AND锛岄泦鍚堜腑鍏冪礌浣跨敤OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) --> + <if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()"> + and + <foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and "> + <trim prefixOverrides="or" prefix="(" suffix=")"> + <include refid="_condition_param_"> + <property name="_conditionParam_" value="andCondition"/> + <property name="_conditionType_" value="or"/> + </include> + </trim> + </foreach> + </if> + <!-- 鏉′欢鏄犲皠-闆嗗悎涔嬮棿浣跨敤OR锛岄泦鍚堜腑鍏冪礌浣跨敤AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) --> + <if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()"> + and + <foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or "> + <trim prefixOverrides="and" prefix="(" suffix=")"> + <include refid="_condition_param_"> + <property name="_conditionParam_" value="orCondition"/> + <property name="_conditionType_" value="and"/> + </include> + </trim> + </foreach> + </if> + </if> + </sql> + <!-- 鏉′欢鏄犲皠-浠e弬鏁� --> + <sql id="_condition_param_"> + <bind name="conditionParamRef" value="${_conditionParam_}"/> + <if test="conditionParamRef.containsKey('id')"> + <if test="conditionParamRef.id != null"> + ${_conditionType_} a.id=#{${_conditionParam_}.id} + </if> + </if> + <if test="conditionParamRef.containsKey('id')"> + <if test="conditionParamRef.id != null "> + ${_conditionType_} a.id = #{${_conditionParam_}.id} + </if> + <if test="conditionParamRef.id == null"> + ${_conditionType_} a.id is null + </if> + </if> + <if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0"> + ${_conditionType_} a.id in + <foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0"> + ${_conditionType_} a.id not in + <foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null"> + ${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart} + </if> + <if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null"> + ${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd} + </if> + + <if test="conditionParamRef.containsKey('userId')"> + <if test="conditionParamRef.userId != null "> + ${_conditionType_} a.userId = #{${_conditionParam_}.userId} + </if> + <if test="conditionParamRef.userId == null"> + ${_conditionType_} a.userId is null + </if> + </if> + <if test="conditionParamRef.containsKey('userIdList') and conditionParamRef.userIdList.size() > 0"> + ${_conditionType_} a.userId in + <foreach collection="conditionParamRef.userIdList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('userIdNotList') and conditionParamRef.userIdNotList.size() > 0"> + ${_conditionType_} a.userId not in + <foreach collection="conditionParamRef.userIdNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('userIdStart') and conditionParamRef.userIdStart != null"> + ${_conditionType_} a.userId <![CDATA[ >= ]]> #{${_conditionParam_}.userIdStart} + </if> + <if test="conditionParamRef.containsKey('userIdEnd') and conditionParamRef.userIdEnd != null"> + ${_conditionType_} a.userId <![CDATA[ <= ]]> #{${_conditionParam_}.userIdEnd} + </if> + + + <if test="conditionParamRef.containsKey('loginName')"> + <if test="conditionParamRef.loginName != null and conditionParamRef.loginName != ''"> + ${_conditionType_} a.loginName like #{${_conditionParam_}.loginName} + </if> + <if test="conditionParamRef.loginName == null"> + ${_conditionType_} a.loginName is null + </if> + </if> + <if test="conditionParamRef.containsKey('loginNameList') and conditionParamRef.loginNameList.size() > 0"> + ${_conditionType_} a.loginName in + <foreach collection="conditionParamRef.loginNameList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('loginNameNotList') and conditionParamRef.loginNameNotList.size() > 0"> + ${_conditionType_} a.loginName not in + <foreach collection="conditionParamRef.loginNameNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + + <if test="conditionParamRef.containsKey('loginPwd')"> + <if test="conditionParamRef.loginPwd != null and conditionParamRef.loginPwd != ''"> + ${_conditionType_} a.loginPwd like #{${_conditionParam_}.loginPwd} + </if> + <if test="conditionParamRef.loginPwd == null"> + ${_conditionType_} a.loginPwd is null + </if> + </if> + <if test="conditionParamRef.containsKey('loginPwdList') and conditionParamRef.loginPwdList.size() > 0"> + ${_conditionType_} a.loginPwd in + <foreach collection="conditionParamRef.loginPwdList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('loginPwdNotList') and conditionParamRef.loginPwdNotList.size() > 0"> + ${_conditionType_} a.loginPwd not in + <foreach collection="conditionParamRef.loginPwdNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + + <if test="conditionParamRef.containsKey('createTime')"> + <if test="conditionParamRef.createTime != null "> + ${_conditionType_} a.createTime = #{${_conditionParam_}.createTime} + </if> + <if test="conditionParamRef.createTime == null"> + ${_conditionType_} a.createTime is null + </if> + </if> + <if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''"> + ${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') + </if> + <if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''"> + ${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') + </if> + <if test="conditionParamRef.containsKey('createUserId')"> + <if test="conditionParamRef.createUserId != null "> + ${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId} + </if> + <if test="conditionParamRef.createUserId == null"> + ${_conditionType_} a.createUserId is null + </if> + </if> + <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0"> + ${_conditionType_} a.createUserId in + <foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0"> + ${_conditionType_} a.createUserId not in + <foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null"> + ${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart} + </if> + <if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null"> + ${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd} + </if> + + </sql> + <sql id="_orderCols_"> + <if test="orderColList != null and !orderColList.isEmpty()"> + order by + <trim suffixOverrides="," suffix=""> + <foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> + ${item.colName} ${item.sortKind} + </foreach> + </trim> + </if> + <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"> + order by + <trim suffixOverrides="," suffix=""> + <if test="orderCol.containsKey('id')"> + a.id + <if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('userId')"> + a.userId + <if test='orderCol.userId != null and "DESC".equalsIgnoreCase(orderCol.userId)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('loginName')"> + a.loginName + <if test='orderCol.loginName != null and "DESC".equalsIgnoreCase(orderCol.loginName)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('loginPwd')"> + a.loginPwd + <if test='orderCol.loginPwd != null and "DESC".equalsIgnoreCase(orderCol.loginPwd)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('createTime')"> + a.createTime + <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('createUserId')"> + a.createUserId + <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if> + , + </if> + </trim> + </if> + </sql> + <sql id="_group_by_"> + <if test="groupList != null and !groupList.isEmpty()"> + GROUP BY + <trim suffixOverrides="," suffix=""> + <foreach collection="groupList" open="" close="" index="index" item="item" separator=","> + ${item} + </foreach> + </trim> + </if> + </sql> +</mapper> \ No newline at end of file diff --git a/datav-manager/src/main/resources/sqlmap/module/customer/CustomerPwdRecordMapper.xml b/datav-manager/src/main/resources/sqlmap/module/customer/CustomerPwdRecordMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..70d6440a32f6a6db48e4d70c79e1f91c239cb5e9 --- /dev/null +++ b/datav-manager/src/main/resources/sqlmap/module/customer/CustomerPwdRecordMapper.xml @@ -0,0 +1,453 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"mybatis-3-mapper.dtd"> +<mapper namespace="com.mortals.xhx.module.customer.dao.ibatis.CustomerPwdRecordDaoImpl"> + + <!-- 瀛楁鍜屽睘鎬ф槧灏� --> + <resultMap type="CustomerPwdRecordEntity" id="CustomerPwdRecordEntity-Map"> + <id property="id" column="id" /> + <result property="userId" column="userId" /> + <result property="loginName" column="loginName" /> + <result property="loginPwd" column="loginPwd" /> + <result property="createTime" column="createTime" /> + <result property="createUserId" column="createUserId" /> + + </resultMap> + + + <!-- 琛ㄦ墍鏈夊垪 --> + <sql id="_columns"> + <trim suffixOverrides="," suffix=""> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))"> + a.id, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('userId') or colPickMode == 1 and data.containsKey('userId')))"> + a.userId, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('loginName') or colPickMode == 1 and data.containsKey('loginName')))"> + a.loginName, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('loginPwd') or colPickMode == 1 and data.containsKey('loginPwd')))"> + a.loginPwd, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))"> + a.createTime, + </if> + <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))"> + a.createUserId, + </if> + </trim> + </sql> + <!-- 鏂板 鍖哄垎涓婚敭鑷鍔犺繕鏄笟鍔℃彃鍏� --> + <insert id="insert" parameterType="CustomerPwdRecordEntity" useGeneratedKeys="true" keyProperty="id"> + insert into mortals_xhx_customer_pwd_record + (userId,loginName,loginPwd,createTime,createUserId) + VALUES + (#{userId},#{loginName},#{loginPwd},#{createTime},#{createUserId}) + </insert> + + <!-- 鎵归噺鏂板 --> + <insert id="insertBatch" parameterType="paramDto"> + insert into mortals_xhx_customer_pwd_record + (userId,loginName,loginPwd,createTime,createUserId) + VALUES + <foreach collection="data.dataList" item="item" index="index" separator="," > + (#{item.userId},#{item.loginName},#{item.loginPwd},#{item.createTime},#{item.createUserId}) + </foreach> + </insert> + + + <!-- 鏍规嵁ParamDto鏇存柊 --> + <update id="update" parameterType="paramDto"> + update mortals_xhx_customer_pwd_record as a + set + <trim suffixOverrides="," suffix=""> + <if test="(colPickMode==0 and data.containsKey('userId')) or (colPickMode==1 and !data.containsKey('userId'))"> + a.userId=#{data.userId}, + </if> + <if test="(colPickMode==0 and data.containsKey('userIdIncrement')) or (colPickMode==1 and !data.containsKey('userIdIncrement'))"> + a.userId=ifnull(a.userId,0) + #{data.userIdIncrement}, + </if> + <if test="(colPickMode==0 and data.containsKey('loginName')) or (colPickMode==1 and !data.containsKey('loginName'))"> + a.loginName=#{data.loginName}, + </if> + <if test="(colPickMode==0 and data.containsKey('loginPwd')) or (colPickMode==1 and !data.containsKey('loginPwd'))"> + a.loginPwd=#{data.loginPwd}, + </if> + <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))"> + a.createTime=#{data.createTime}, + </if> + <if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))"> + a.createUserId=#{data.createUserId}, + </if> + <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))"> + a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement}, + </if> + </trim> + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + </update> + <!-- 鎵归噺鏇存柊 --> + <update id="updateBatch" parameterType="paramDto"> + update mortals_xhx_customer_pwd_record as a + <trim prefix="set" suffixOverrides=","> + <trim prefix="userId=(case" suffix="ELSE userId end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <choose> + <when test="(colPickMode==0 and item.containsKey('userId')) or (colPickMode==1 and !item.containsKey('userId'))"> + when a.id=#{item.id} then #{item.userId} + </when> + <when test="(colPickMode==0 and item.containsKey('userIdIncrement')) or (colPickMode==1 and !item.containsKey('userIdIncrement'))"> + when a.id=#{item.id} then ifnull(a.userId,0) + #{item.userIdIncrement} + </when> + </choose> + </foreach> + </trim> + <trim prefix="loginName=(case" suffix="ELSE loginName end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <if test="(colPickMode==0 and item.containsKey('loginName')) or (colPickMode==1 and !item.containsKey('loginName'))"> + when a.id=#{item.id} then #{item.loginName} + </if> + </foreach> + </trim> + <trim prefix="loginPwd=(case" suffix="ELSE loginPwd end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <if test="(colPickMode==0 and item.containsKey('loginPwd')) or (colPickMode==1 and !item.containsKey('loginPwd'))"> + when a.id=#{item.id} then #{item.loginPwd} + </if> + </foreach> + </trim> + <trim prefix="createTime=(case" suffix="ELSE createTime end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))"> + when a.id=#{item.id} then #{item.createTime} + </if> + </foreach> + </trim> + <trim prefix="createUserId=(case" suffix="ELSE createUserId end),"> + <foreach collection="data.dataList" item="item" index="index" separator="" > + <choose> + <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))"> + when a.id=#{item.id} then #{item.createUserId} + </when> + <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))"> + when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement} + </when> + </choose> + </foreach> + </trim> + </trim> + where id in + <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> + #{item.id} + </foreach> + </update> + <!-- 鏍规嵁涓诲仴鏌ヨ --> + <select id="getByKey" parameterType="paramDto" resultMap="CustomerPwdRecordEntity-Map"> + select <include refid="_columns"/> + from mortals_xhx_customer_pwd_record as a + where a.id=#{condition.id} + </select> + <!-- 鏍规嵁涓诲仴鍒犻櫎 --> + <delete id="deleteByKey" parameterType="paramDto"> + delete a.* from mortals_xhx_customer_pwd_record as a where a.id=#{condition.id} + </delete> + <!-- 鏍规嵁涓诲仴鍒犻櫎涓€鎵癸紝閽堝鍗曚竴涓诲仴鏈夋晥 --> + <delete id="deleteByKeys"> + delete from mortals_xhx_customer_pwd_record where id in + <foreach collection="array" item="item" index="index" open="(" separator="," close=")"> + #{item} + </foreach> + </delete> + <!-- 鏍规嵁涓诲仴鍒楄〃鍒犻櫎涓€鎵癸紝閽堝鍗曚竴涓诲仴鏈夋晥 --> + <delete id="deleteByKeyList"> + delete from mortals_xhx_customer_pwd_record where id in + <foreach collection="list" item="item" index="index" open="(" separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 鏍规嵁瀵硅薄鍒楄〃鍒犻櫎涓€鎵癸紝閽堝鍗曚竴涓诲仴鏈夋晥 --> + <delete id="deleteByEntityList"> + delete from mortals_xhx_customer_pwd_record where id in + <foreach collection="list" item="item" index="index" open="(" separator="," close=")"> + #{item.id} + </foreach> + </delete> + <!-- 鏍规嵁paramDto鍒犻櫎涓€鎵� --> + <delete id="deleteByMap" parameterType="paramDto"> + delete a.* from mortals_xhx_customer_pwd_record as a + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + </delete> + <!-- 鑾峰彇鍒楄〃 --> + <select id="getList" parameterType="paramDto" resultMap="CustomerPwdRecordEntity-Map"> + select <include refid="_columns"/> + from mortals_xhx_customer_pwd_record as a + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + <include refid="_orderCols_"/> + </select> + + + + <!-- 鑾峰彇 --> + <select id="getListCount" parameterType="paramDto" resultType="int"> + select count(1) + from mortals_xhx_customer_pwd_record as a + <trim suffixOverrides="where" suffix=""> + where + <trim prefixOverrides="and" prefix=""> + <include refid="_condition_"/> + </trim> + </trim> + </select> + <!-- 鏉′欢鏄犲皠 --> + <sql id="_condition_"> + <if test="condition != null and !condition.isEmpty()"> + <!-- 鏉′欢鏄犲皠-鏅€氭潯浠� --> + <include refid="_condition_param_"> + <property name="_conditionParam_" value="condition"/> + <property name="_conditionType_" value="and"/> + </include> + <!-- 鏉′欢鏄犲皠-闆嗗悎涔嬮棿浣跨敤AND锛岄泦鍚堜腑鍏冪礌浣跨敤OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) --> + <if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()"> + and + <foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and "> + <trim prefixOverrides="or" prefix="(" suffix=")"> + <include refid="_condition_param_"> + <property name="_conditionParam_" value="andCondition"/> + <property name="_conditionType_" value="or"/> + </include> + </trim> + </foreach> + </if> + <!-- 鏉′欢鏄犲皠-闆嗗悎涔嬮棿浣跨敤OR锛岄泦鍚堜腑鍏冪礌浣跨敤AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) --> + <if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()"> + and + <foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or "> + <trim prefixOverrides="and" prefix="(" suffix=")"> + <include refid="_condition_param_"> + <property name="_conditionParam_" value="orCondition"/> + <property name="_conditionType_" value="and"/> + </include> + </trim> + </foreach> + </if> + </if> + </sql> + <!-- 鏉′欢鏄犲皠-浠e弬鏁� --> + <sql id="_condition_param_"> + <bind name="conditionParamRef" value="${_conditionParam_}"/> + <if test="conditionParamRef.containsKey('id')"> + <if test="conditionParamRef.id != null"> + ${_conditionType_} a.id=#{${_conditionParam_}.id} + </if> + </if> + <if test="conditionParamRef.containsKey('id')"> + <if test="conditionParamRef.id != null "> + ${_conditionType_} a.id = #{${_conditionParam_}.id} + </if> + <if test="conditionParamRef.id == null"> + ${_conditionType_} a.id is null + </if> + </if> + <if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0"> + ${_conditionType_} a.id in + <foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0"> + ${_conditionType_} a.id not in + <foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null"> + ${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart} + </if> + <if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null"> + ${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd} + </if> + + <if test="conditionParamRef.containsKey('userId')"> + <if test="conditionParamRef.userId != null "> + ${_conditionType_} a.userId = #{${_conditionParam_}.userId} + </if> + <if test="conditionParamRef.userId == null"> + ${_conditionType_} a.userId is null + </if> + </if> + <if test="conditionParamRef.containsKey('userIdList') and conditionParamRef.userIdList.size() > 0"> + ${_conditionType_} a.userId in + <foreach collection="conditionParamRef.userIdList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('userIdNotList') and conditionParamRef.userIdNotList.size() > 0"> + ${_conditionType_} a.userId not in + <foreach collection="conditionParamRef.userIdNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('userIdStart') and conditionParamRef.userIdStart != null"> + ${_conditionType_} a.userId <![CDATA[ >= ]]> #{${_conditionParam_}.userIdStart} + </if> + <if test="conditionParamRef.containsKey('userIdEnd') and conditionParamRef.userIdEnd != null"> + ${_conditionType_} a.userId <![CDATA[ <= ]]> #{${_conditionParam_}.userIdEnd} + </if> + + + <if test="conditionParamRef.containsKey('loginName')"> + <if test="conditionParamRef.loginName != null and conditionParamRef.loginName != ''"> + ${_conditionType_} a.loginName like #{${_conditionParam_}.loginName} + </if> + <if test="conditionParamRef.loginName == null"> + ${_conditionType_} a.loginName is null + </if> + </if> + <if test="conditionParamRef.containsKey('loginNameList') and conditionParamRef.loginNameList.size() > 0"> + ${_conditionType_} a.loginName in + <foreach collection="conditionParamRef.loginNameList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('loginNameNotList') and conditionParamRef.loginNameNotList.size() > 0"> + ${_conditionType_} a.loginName not in + <foreach collection="conditionParamRef.loginNameNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + + <if test="conditionParamRef.containsKey('loginPwd')"> + <if test="conditionParamRef.loginPwd != null and conditionParamRef.loginPwd != ''"> + ${_conditionType_} a.loginPwd like #{${_conditionParam_}.loginPwd} + </if> + <if test="conditionParamRef.loginPwd == null"> + ${_conditionType_} a.loginPwd is null + </if> + </if> + <if test="conditionParamRef.containsKey('loginPwdList') and conditionParamRef.loginPwdList.size() > 0"> + ${_conditionType_} a.loginPwd in + <foreach collection="conditionParamRef.loginPwdList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('loginPwdNotList') and conditionParamRef.loginPwdNotList.size() > 0"> + ${_conditionType_} a.loginPwd not in + <foreach collection="conditionParamRef.loginPwdNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + + <if test="conditionParamRef.containsKey('createTime')"> + <if test="conditionParamRef.createTime != null "> + ${_conditionType_} a.createTime = #{${_conditionParam_}.createTime} + </if> + <if test="conditionParamRef.createTime == null"> + ${_conditionType_} a.createTime is null + </if> + </if> + <if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''"> + ${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') + </if> + <if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''"> + ${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') + </if> + <if test="conditionParamRef.containsKey('createUserId')"> + <if test="conditionParamRef.createUserId != null "> + ${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId} + </if> + <if test="conditionParamRef.createUserId == null"> + ${_conditionType_} a.createUserId is null + </if> + </if> + <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0"> + ${_conditionType_} a.createUserId in + <foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0"> + ${_conditionType_} a.createUserId not in + <foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=","> + #{item} + </foreach> + </if> + <if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null"> + ${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart} + </if> + <if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null"> + ${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd} + </if> + + </sql> + <sql id="_orderCols_"> + <if test="orderColList != null and !orderColList.isEmpty()"> + order by + <trim suffixOverrides="," suffix=""> + <foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> + ${item.colName} ${item.sortKind} + </foreach> + </trim> + </if> + <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"> + order by + <trim suffixOverrides="," suffix=""> + <if test="orderCol.containsKey('id')"> + a.id + <if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('userId')"> + a.userId + <if test='orderCol.userId != null and "DESC".equalsIgnoreCase(orderCol.userId)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('loginName')"> + a.loginName + <if test='orderCol.loginName != null and "DESC".equalsIgnoreCase(orderCol.loginName)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('loginPwd')"> + a.loginPwd + <if test='orderCol.loginPwd != null and "DESC".equalsIgnoreCase(orderCol.loginPwd)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('createTime')"> + a.createTime + <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if> + , + </if> + <if test="orderCol.containsKey('createUserId')"> + a.createUserId + <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if> + , + </if> + </trim> + </if> + </sql> + <sql id="_group_by_"> + <if test="groupList != null and !groupList.isEmpty()"> + GROUP BY + <trim suffixOverrides="," suffix=""> + <foreach collection="groupList" open="" close="" index="index" item="item" separator=","> + ${item} + </foreach> + </trim> + </if> + </sql> +</mapper> \ No newline at end of file