Commit 95e093bc by Water Wang

Merge remote-tracking branch 'origin/dev_20200521_securityscan' into dev

parents 2961d4fb b6ca5812
package com.yd.api;
import java.io.IOException;
import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ErrorAttributes;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.yd.api.result.CommonResult;
import com.yd.api.result.ErrorResponseVO;
import com.yd.api.result.JsonResult;
/**
*
* @author Simon Cheng
*
*/
@Controller
public class AppErrorController implements ErrorController{
private static final Logger logger = LoggerFactory.getLogger(AppErrorController.class);
private static AppErrorController appErrorController;
/**
* Error Attributes in the Application
*/
@Autowired
private ErrorAttributes errorAttributes;
private final static String ERROR_PATH = "/error";
/**
* Controller for the Error Controller
* @param errorAttributes
* @return
*/
public AppErrorController(ErrorAttributes errorAttributes) {
this.errorAttributes = errorAttributes;
}
public AppErrorController() {
if(appErrorController == null){
appErrorController = new AppErrorController(errorAttributes);
}
}
/**
* Supports the HTML Error View
* @param request
* @return
*/
@RequestMapping(value = ERROR_PATH, produces = "text/html")
public void errorHtml(HttpServletRequest request,HttpServletResponse response) {
Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String redirectURL = "/ydapi/errorunknown.html";
if (status != null) {
Integer statusCode = Integer.valueOf(status.toString());
if (statusCode == HttpStatus.NOT_FOUND.value()) {
redirectURL = "/ydapi/error404.html";
}else if(statusCode == HttpStatus.INTERNAL_SERVER_ERROR.value()) {
redirectURL = "/ydapi/error500.html";
}else {
redirectURL = "/ydapi/errorunknown.html";
}
}
try {
response.sendRedirect(redirectURL);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Supports other formats like JSON, XML
* @param request
* @return
*/
@RequestMapping(value = ERROR_PATH)
@ResponseBody
public Object error(HttpServletRequest request) {
Map<String, Object> body = getErrorAttributes(request, getTraceParameter(request));
HttpStatus status = getStatus(request);
JsonResult result = new JsonResult();
ErrorResponseVO errorResponseVO = new ErrorResponseVO();
errorResponseVO.setCommonResult(new CommonResult(false,"API not exist! Please go to our home page https://www.ydinsurance.cn/, or call 13661741633."));
result.setData(new ResponseEntity<Map<String, Object>>(body, status));
result.addResult(errorResponseVO);
return result;
}
/**
* Returns the path of the error page.
*
* @return the error path
*/
@Override
public String getErrorPath() {
return ERROR_PATH;
}
private boolean getTraceParameter(HttpServletRequest request) {
String parameter = request.getParameter("trace");
if (parameter == null) {
return false;
}
return !"false".equals(parameter.toLowerCase());
}
private Map<String, Object> getErrorAttributes(HttpServletRequest request,
boolean includeStackTrace) {
RequestAttributes requestAttributes = new ServletRequestAttributes(request);
Map<String, Object> map = this.errorAttributes.getErrorAttributes(requestAttributes,includeStackTrace);
String URL = request.getRequestURL().toString();
map.put("URL", URL);
logger.debug("AppErrorController.method [error info]: status-" + map.get("status") +", request url-" + URL);
return map;
}
private HttpStatus getStatus(HttpServletRequest request) {
Integer statusCode = (Integer) request
.getAttribute("javax.servlet.error.status_code");
if (statusCode != null) {
try {
return HttpStatus.valueOf(statusCode);
}
catch (Exception ex) {
}
}
return HttpStatus.INTERNAL_SERVER_ERROR;
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo;
import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.practitioner.opportunity.PlayerSalesActivityInfo;
import com.yd.dal.entity.survey.SurveyCustomerAnswers;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.service.customer.*;
import com.yd.dal.service.marketing.*;
import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
......@@ -43,6 +44,7 @@ import com.yd.dal.service.marketing.MktLeadsGoalsDALService;
import com.yd.dal.service.meta.*;
import com.yd.dal.service.order.PoOrderDALService;
import com.yd.dal.service.survey.SurveyCustomerAnswersDALService;
import com.yd.dal.service.user.AclUserDALService;
import com.yd.dal.entity.customer.practitioner.*;
import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService;
......
/**
*
*/
package com.yd.api.result;
/**
* @author Simon Cheng
*
*/
public class ErrorResponseVO {
private CommonResult commonResult;
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
\ No newline at end of file
package com.yd.api.user;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yd.api.practitioner.service.PractitionerService;
import com.yd.api.result.JsonResult;
import com.yd.api.security.vo.DESCommonVO;
import com.yd.api.user.service.UserService;
import com.yd.api.user.vo.UserRequestVO;
import com.yd.api.user.vo.UserVO;
import com.yd.util.deshandler.DESTypeHandler;
@RestController
@RequestMapping(value="/user")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("/insert")
public Object encrypt(@RequestBody UserVO requestVO) throws Exception{
JsonResult result = new JsonResult();
int resultNum = 0;
try {
resultNum = userService.insert(requestVO);
} catch (Exception e) {
e.printStackTrace();
}
result.setData(resultNum);
return result;
}
@RequestMapping("/findByIds")
public Object Decrypt(@RequestBody UserRequestVO userRequestVO) throws Exception{
JsonResult result = new JsonResult();
List<UserVO> listVO = new ArrayList<UserVO>();
try {
listVO = userService.findByIds(userRequestVO.getUserIdList());
} catch (Exception e) {
e.printStackTrace();
}
result.setData(listVO);
return result;
}
}
package com.yd.api.user.service;
import com.yd.api.user.vo.UserVO;
import com.yd.dal.entity.user.AclUser;
import java.util.List;
import org.springframework.stereotype.Service;
@Service("UserService")
public interface UserService {
int deleteByPrimaryKey(Long id);
int insert(UserVO record);
int insertSelective(UserVO record);
UserVO selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(UserVO record);
int updateByPrimaryKey(UserVO record);
List<UserVO> findByIds(List<Long> userIdList);
}
package com.yd.api.user.service.impl;
import com.yd.api.user.vo.UserVO;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.service.user.AclUserDALService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("userService")
public class UserServiceImpl implements com.yd.api.user.service.UserService {
@Autowired
private AclUserDALService userDALService;
@Override
public int deleteByPrimaryKey(Long id) {
return userDALService.deleteByPrimaryKey(id);
}
@Override
public int insert(UserVO record) {
AclUser one = new AclUser();
BeanUtils.copyProperties(record, one);
return userDALService.insert(one);
}
@Override
public int insertSelective(UserVO record) {
AclUser one = new AclUser();
BeanUtils.copyProperties(record, one);
return userDALService.insertSelective(one);
}
@Override
public UserVO selectByPrimaryKey(Long id) {
AclUser one = new AclUser();
UserVO record = new UserVO();
one = userDALService.selectByPrimaryKey(id);
BeanUtils.copyProperties(one,record);
return record;
}
@Override
public int updateByPrimaryKeySelective(UserVO record) {
AclUser one = new AclUser();
BeanUtils.copyProperties(record, one);
return userDALService.updateByPrimaryKeySelective(one);
}
@Override
public int updateByPrimaryKey(UserVO record) {
AclUser one = new AclUser();
BeanUtils.copyProperties(record, one);
return userDALService.updateByPrimaryKey(one);
}
@Override
public List<UserVO> findByIds(List<Long> userIdList) {
List<UserVO> voUserList = new ArrayList<UserVO>();
List<AclUser> daUserList = userDALService.findByIds(userIdList);
for(AclUser one:daUserList)
{
UserVO record = new UserVO();
BeanUtils.copyProperties(one, record);
voUserList.add(record);
}
return voUserList;
}
}
package com.yd.api.user.vo;
import java.util.List;
public class UserRequestVO {
private List<Long> userIdList;
public List<Long> getUserIdList() {
return userIdList;
}
public void setUserIdList(List<Long> userIdList) {
this.userIdList = userIdList;
}
}
\ No newline at end of file
package com.yd.api.user.vo;
import java.util.Date;
public class UserVO {
private Long id;
private Integer userRole;
private String employeeNo;
private Integer company;
private Long deptId;
private Long roleId;
private String login;
private String password;
private String name;
private String nickname;
private String mobileNo;
private String idNo;
private Date lastLoginTime;
private Date logoutTime;
private Integer loginSource;
private Integer isActive;
private String email;
private Date createdAt;
private Long createdBy;
private Date updatedAt;
private Long updatedBy;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getUserRole() {
return userRole;
}
public void setUserRole(Integer userRole) {
this.userRole = userRole;
}
public String getEmployeeNo() {
return employeeNo;
}
public void setEmployeeNo(String employeeNo) {
this.employeeNo = employeeNo == null ? null : employeeNo.trim();
}
public Integer getCompany() {
return company;
}
public void setCompany(Integer company) {
this.company = company;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login == null ? null : login.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname == null ? null : nickname.trim();
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo == null ? null : mobileNo.trim();
}
public String getIdNo() {
return idNo;
}
public void setIdNo(String idNo) {
this.idNo = idNo == null ? null : idNo.trim();
}
public Date getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(Date lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public Date getLogoutTime() {
return logoutTime;
}
public void setLogoutTime(Date logoutTime) {
this.logoutTime = logoutTime;
}
public Integer getLoginSource() {
return loginSource;
}
public void setLoginSource(Integer loginSource) {
this.loginSource = loginSource;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
}
\ No newline at end of file
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_user
* @author
*/
@Data
public class AclUser implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 1= Staff 2.Customer 3.Partner
*/
private Integer userRole;
/**
* 员工编号
*/
private String employeeNo;
/**
* 1= 安吉保 2=银盾
*/
private Integer company;
/**
* FK ag_system_dept.id
*/
private Long deptId;
/**
* FK ag_system_role.id
*/
private Long roleId;
/**
* login ID
*/
private String login;
/**
* 88888888
*/
private String password;
/**
* user name
*/
private String name;
/**
* user nickname
*/
private String nickname;
private String mobileNo;
private String idNo;
/**
* 最后登入时间
*/
private Date lastLoginTime;
/**
* 最后登出时间
*/
private Date logoutTime;
/**
* 1=PC 2=Mobile 3=Pad
*/
private Integer loginSource;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 员工email
*/
private String email;
/**
* 创建日期
*/
private Date createdAt;
/**
* creator
*/
private Long createdBy;
/**
* 0000-00-00 00:00:00
*/
private Date updatedAt;
/**
* updator, FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.user;
import java.util.Date;
public class AclUser {
private Long id;
private Integer userRole;
private String employeeNo;
private Integer company;
private Long deptId;
private Long roleId;
private String login;
private String password;
private String name;
private String nickname;
private String mobileNo;
private String idNo;
private Date lastLoginTime;
private Date logoutTime;
private Integer loginSource;
private Integer isActive;
private String email;
private Date createdAt;
private Long createdBy;
private Date updatedAt;
private Long updatedBy;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getUserRole() {
return userRole;
}
public void setUserRole(Integer userRole) {
this.userRole = userRole;
}
public String getEmployeeNo() {
return employeeNo;
}
public void setEmployeeNo(String employeeNo) {
this.employeeNo = employeeNo == null ? null : employeeNo.trim();
}
public Integer getCompany() {
return company;
}
public void setCompany(Integer company) {
this.company = company;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login == null ? null : login.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname == null ? null : nickname.trim();
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo == null ? null : mobileNo.trim();
}
public String getIdNo() {
return idNo;
}
public void setIdNo(String idNo) {
this.idNo = idNo == null ? null : idNo.trim();
}
public Date getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(Date lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public Date getLogoutTime() {
return logoutTime;
}
public void setLogoutTime(Date logoutTime) {
this.logoutTime = logoutTime;
}
public Integer getLoginSource() {
return loginSource;
}
public void setLoginSource(Integer loginSource) {
this.loginSource = loginSource;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
package com.yd.dal.mapper.user;
import java.util.List;
import com.yd.dal.entity.customer.AclUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.yd.dal.entity.user.AclUser;
public interface AclUserMapper {
public interface UserMapper {
int deleteByPrimaryKey(Long id);
int insert(AclUser record);
......@@ -17,6 +18,6 @@ public interface AclUserMapper {
int updateByPrimaryKeySelective(AclUser record);
int updateByPrimaryKey(AclUser record);
List<AclUser> findByIds(@Param("userIdList") List<Long> userIdList);
}
\ No newline at end of file
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclUser;
import com.yd.dal.mapper.customer.AclUserMapper;
import com.yd.dal.service.customer.AclUserDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclUserDALService")
public class AclUserDALServiceImpl implements AclUserDALService {
@Resource
private AclUserMapper aclUserMapper;
@Override
public List<AclUser> findByIds(List<Long> userIdList) {
return aclUserMapper.findByIds(userIdList);
}
}
package com.yd.dal.service.customer;
package com.yd.dal.service.user;
import com.yd.dal.entity.customer.AclUser;
import com.yd.dal.entity.user.AclUser;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclUserDALService")
public interface AclUserDALService {
int deleteByPrimaryKey(Long id);
int insert(AclUser record);
int insertSelective(AclUser record);
AclUser selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclUser record);
int updateByPrimaryKey(AclUser record);
List<AclUser> findByIds(List<Long> userIdList);
}
package com.yd.dal.service.user.impl;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.user.UserMapper;
import com.yd.dal.service.user.AclUserDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclUserDALService")
public class AclUserDALServiceImpl implements AclUserDALService {
@Resource
private UserMapper aclUserMapper;
@Override
public List<AclUser> findByIds(List<Long> userIdList) {
return aclUserMapper.findByIds(userIdList);
}
@Override
public int deleteByPrimaryKey(Long id) {
return aclUserMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(AclUser record) {
return aclUserMapper.insert(record);
}
@Override
public int insertSelective(AclUser record) {
return aclUserMapper.insertSelective(record);
}
@Override
public AclUser selectByPrimaryKey(Long id) {
return aclUserMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(AclUser record) {
return aclUserMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(AclUser record) {
return aclUserMapper.updateByPrimaryKey(record);
}
}
......@@ -42,7 +42,8 @@ public class HttpZuihuibiAuthorizeFilter implements Filter{
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)throws IOException, ServletException{
HttpServletRequest httpRequest = (HttpServletRequest)request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setHeader("Access-Control-Allow-Origin", "*");
httpResponse.setHeader("Access-Control-Allow-Origin", "*");
httpResponse.setHeader("x-frame-options","x-frame-options");
String requestUri = httpRequest.getRequestURI();
boolean isDoFilter = false;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.customer.AclUserMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclUser">
<mapper namespace="com.yd.dal.mapper.user.UserMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.user.AclUser">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_role" jdbcType="INTEGER" property="userRole" />
<result column="employee_no" jdbcType="VARCHAR" property="employeeNo" />
......@@ -12,8 +12,8 @@
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" />
<result column="id_no" jdbcType="VARCHAR" property="idNo" />
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="id_no" jdbcType="VARCHAR" property="idNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
<result column="logout_time" jdbcType="TIMESTAMP" property="logoutTime" />
<result column="login_source" jdbcType="INTEGER" property="loginSource" />
......@@ -25,48 +25,53 @@
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, user_role, employee_no, company, dept_id, role_id, `login`, `password`, `name`,
nickname, mobile_no, id_no, last_login_time, logout_time, login_source, is_active,
email, created_at, created_by, updated_at, updated_by
id, user_role, employee_no, company, dept_id, role_id, login, password, name, nickname,
mobile_no, id_no, last_login_time, logout_time, login_source, is_active, email, created_at,
created_by, updated_at, updated_by
</sql>
<select id="findByIds" resultType="com.yd.dal.entity.user.AclUser" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_user
where id in
<foreach collection="userIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_user
where id = #{id,jdbcType=BIGINT}
</select>
<select id="findByIds" resultType="com.yd.dal.entity.customer.AclUser">
select
<include refid="Base_Column_List" />
from ag_acl_user
where id in
<foreach collection="userIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_user
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclUser" useGeneratedKeys="true">
insert into ag_acl_user (user_role, employee_no, company,
dept_id, role_id, `login`,
`password`, `name`, nickname,
mobile_no, id_no, last_login_time,
logout_time, login_source, is_active,
email, created_at, created_by,
updated_at, updated_by)
values (#{userRole,jdbcType=INTEGER}, #{employeeNo,jdbcType=VARCHAR}, #{company,jdbcType=INTEGER},
#{deptId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, #{login,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR},
#{mobileNo,jdbcType=VARCHAR}, #{idNo,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
#{logoutTime,jdbcType=TIMESTAMP}, #{loginSource,jdbcType=INTEGER}, #{isActive,jdbcType=INTEGER},
#{email,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
#{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT})
<insert id="insert" parameterType="com.yd.dal.entity.user.AclUser">
insert into ag_acl_user (id, user_role, employee_no,
company, dept_id, role_id,
login, password, name,
nickname, mobile_no, id_no,
last_login_time, logout_time, login_source,
is_active, email, created_at,
created_by, updated_at, updated_by
)
values (#{id,jdbcType=BIGINT}, #{userRole,jdbcType=INTEGER}, #{employeeNo,jdbcType=VARCHAR},
#{company,jdbcType=INTEGER}, #{deptId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT},
#{login,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}, #{idNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
#{lastLoginTime,jdbcType=TIMESTAMP}, #{logoutTime,jdbcType=TIMESTAMP}, #{loginSource,jdbcType=INTEGER},
#{isActive,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclUser" useGeneratedKeys="true">
<insert id="insertSelective" parameterType="com.yd.dal.entity.user.AclUser">
insert into ag_acl_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userRole != null">
user_role,
</if>
......@@ -83,13 +88,13 @@
role_id,
</if>
<if test="login != null">
`login`,
login,
</if>
<if test="password != null">
`password`,
password,
</if>
<if test="name != null">
`name`,
name,
</if>
<if test="nickname != null">
nickname,
......@@ -129,6 +134,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userRole != null">
#{userRole,jdbcType=INTEGER},
</if>
......@@ -157,10 +165,10 @@
#{nickname,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
#{mobileNo,jdbcType=VARCHAR},
#{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="idNo != null">
#{idNo,jdbcType=VARCHAR},
#{idNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
......@@ -191,7 +199,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclUser">
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.user.AclUser">
update ag_acl_user
<set>
<if test="userRole != null">
......@@ -210,22 +218,22 @@
role_id = #{roleId,jdbcType=BIGINT},
</if>
<if test="login != null">
`login` = #{login,jdbcType=VARCHAR},
login = #{login,jdbcType=VARCHAR},
</if>
<if test="password != null">
`password` = #{password,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
mobile_no = #{mobileNo,jdbcType=VARCHAR},
mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="idNo != null">
id_no = #{idNo,jdbcType=VARCHAR},
id_no = #{idNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
......@@ -257,19 +265,19 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclUser">
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.user.AclUser">
update ag_acl_user
set user_role = #{userRole,jdbcType=INTEGER},
employee_no = #{employeeNo,jdbcType=VARCHAR},
company = #{company,jdbcType=INTEGER},
dept_id = #{deptId,jdbcType=BIGINT},
role_id = #{roleId,jdbcType=BIGINT},
`login` = #{login,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
login = #{login,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
mobile_no = #{mobileNo,jdbcType=VARCHAR},
id_no = #{idNo,jdbcType=VARCHAR},
mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
id_no = #{idNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
logout_time = #{logoutTime,jdbcType=TIMESTAMP},
login_source = #{loginSource,jdbcType=INTEGER},
......
<!DOCTYPE html>
<html lang="en">
<head>
<title>We've got some trouble</title>
</head>
<body>
<div class="cover">
<h1>Our apologies for resource not found.</h1>
<p class="lead">This API stepped out for a quick ride.</p>
<p>Please go to our home page <a href ="https://www.ydinsurance.cn/" target = "_blank">https://www.ydinsurance.cn/</a>, or call 13661741633.</p>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>We've got some trouble</title>
</head>
<body>
<div class="cover">
<h1>Our apologies for internal error.</h1>
<p class="lead">This API stepped out for a quick ride.</p>
<p>Please go to our home page <a href ="https://www.ydinsurance.cn/" target = "_blank">https://www.ydinsurance.cn/</a>, or call 13661741633.</p>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>We've got some trouble</title>
</head>
<body>
<div class="cover">
<h1>Our apologies for unknown error.</h1>
<p class="lead">This API stepped out for a quick ride.</p>
<p>Please go to our home page <a href ="https://www.ydinsurance.cn/" target = "_blank">https://www.ydinsurance.cn/</a>, or call 13661741633.</p>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment