person,cert
parent
f84f05ae52
commit
fa6457abb0
@ -0,0 +1,15 @@
|
|||||||
|
package com.glxp.api.dao.auth;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.glxp.api.dao.BaseMapperPlus;
|
||||||
|
import com.glxp.api.entity.auth.UserCertEntity;
|
||||||
|
import com.glxp.api.req.auth.UserCertFilterRequest;
|
||||||
|
|
||||||
|
public interface UserCertDao extends BaseMapperPlus<UserCertDao, UserCertEntity, UserCertEntity> {
|
||||||
|
|
||||||
|
List<UserCertEntity> filterUserCerts(UserCertFilterRequest userCertFilterRequest);
|
||||||
|
List<UserCertEntity> selectByRegisterId(@Param("registerId") String registerId);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.glxp.api.req.auth;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserCertFilterRequest extends ListPageRequest {
|
||||||
|
private String registerId;
|
||||||
|
private String companyId;
|
||||||
|
private String name;
|
||||||
|
private String code;
|
||||||
|
private String checkStatus;
|
||||||
|
private String registerTime;
|
||||||
|
private String checkTime;
|
||||||
|
private String status;
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.glxp.api.service.auth;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.auth.UserCertEntity;
|
||||||
|
import com.glxp.api.req.auth.UserCertFilterRequest;
|
||||||
|
|
||||||
|
public interface UserCertService {
|
||||||
|
|
||||||
|
List<UserCertEntity> filterUserCerts(UserCertFilterRequest userCertFilterRequest);
|
||||||
|
List<UserCertEntity> selectByRegisterId(String registerId);
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.glxp.api.service.auth.impl;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.auth.UserCertDao;
|
||||||
|
import com.glxp.api.entity.auth.UserCertEntity;
|
||||||
|
import com.glxp.api.req.auth.UserCertFilterRequest;
|
||||||
|
import com.glxp.api.service.auth.UserCertService;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class UserCertServiceImpl implements UserCertService {
|
||||||
|
@Resource
|
||||||
|
UserCertDao userCertDao;
|
||||||
|
@Override
|
||||||
|
public List<UserCertEntity> filterUserCerts(UserCertFilterRequest userCertFilterRequest) {
|
||||||
|
if (userCertFilterRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
int offset = (userCertFilterRequest.getPage() - 1) * userCertFilterRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, userCertFilterRequest.getLimit());
|
||||||
|
return userCertDao.filterUserCerts(userCertFilterRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserCertEntity> selectByRegisterId(String registerId) {
|
||||||
|
return userCertDao.selectByRegisterId(registerId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
<?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.glxp.api.dao.auth.UserCertDao">
|
||||||
|
|
||||||
|
<select id="filterUserCerts" parameterType="com.glxp.api.req.auth.UserCertFilterRequest"
|
||||||
|
resultType="com.glxp.api.entity.auth.UserCertEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM user_cert
|
||||||
|
<where>
|
||||||
|
<if test="registerId != null and ''!=registerId">
|
||||||
|
AND registerId = #{registerId}
|
||||||
|
</if>
|
||||||
|
<if test="companyId != null and ''!=companyId">
|
||||||
|
AND companyId = #{companyId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="name != null and ''!=name">
|
||||||
|
AND name = #{name}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByRegisterId" parameterType="java.lang.String"
|
||||||
|
resultType="com.glxp.api.entity.auth.UserCertEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM user_cert
|
||||||
|
where registerId=#{registerId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="roleId" useGeneratedKeys="true"
|
||||||
|
parameterType="com.glxp.api.entity.auth.UserCertEntity">
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateById" parameterType="com.glxp.api.entity.auth.UserCertEntity">
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBatchIds" parameterType="java.util.List"
|
||||||
|
>
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="java.lang.Long">
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue