사용자 리스트 조회 오류 수정.

강석 최 2022-10-19 15:23:11 +09:00
parent 7cab96cb55
commit 6829c3328c
2 changed files with 75 additions and 48 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashSet;
@ -31,22 +32,66 @@ public class UserInfo extends BaseModel implements UserDetails{
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_seq")
private Integer userSeq;
@Column(name = "dic_code")
private String dicCode;
@Column(name = "user_id")
private String userId;
@Column(name = "passwd")
private String password;
@Column(name = "user_nm")
private String userNm;
@Column(name = "og_cd")
private String ogCd;
@Column(name = "ofc_cd")
private String ofcCd;
@Column(name = "birth_date")
private LocalDate birthDate;
@Column(name = "sex")
private String sex;
@Column(name = "email")
private String email;
@Column(name = "phone_no")
private String phoneNo;
@Column(name = "area_cd")
private String areaCd;
@Column(name = "login_chk")
private String loginChk;
@Column(name = "fail_cnt")
private Integer failCnt;
@Column(name = "user_role")
private String userRole;
@Column(name = "user_status")
private String userStatus;
@Column(name = "og_cd")
private String ogCd;
@Column(name = "ofc_cd")
private String ofcCd;
@Column(name = "title_cd")
private String titleCd;
@Column(name = "wrt_dt")
private LocalDateTime wrtDt;
@Column(name = "group_cd")
private String groupCd;
@Column(name = "series_cd")
private String seriesCd;
@Column(name = "ofc_head_yn")
private String ofcHeadYn;
@Column(name = "hiring_cd")
private String hiringCd;
@Column(name = "employ_cd")
private String employCd;
@Column(name = "outturn_cd")
private String outturnCd;
@Column(name = "work_cd")
private String workCd;
@Column(name = "job_in_cd")
private String jobInCd;
@Column(name = "language_cd")
private String languageCd;
@Column(name = "police_in_date")
private LocalDate policeInDate;
@Column(name = "organ_in_date")
private LocalDate organInDate;
@Column(name = "ofc_in_date")
private LocalDate ofcInDate;
@Column(name = "title_in_date")
private LocalDate titleInDate;
@Transient
private String modifyPassword;

View File

@ -4,39 +4,41 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dbnt.faisp.userInfo.mapper.UserInfoMapper">
<sql id="selectUserInfoWhere">
<where>
<choose>
<when test="userStatus != null and userStatus != ''">
user_status = #{userStatus}
</when>
<otherwise>
user_status != 'D'
</otherwise>
</choose>
<if test="userId != null and userId != ''">
and user_id like '%'||#{userId}||'%'
</if>
<if test="userNm != null and userNm != ''">
and user_nm like '%'||#{userNm}||'%'
</if>
<if test="ogCd != null and ogCd != ''">
and og_cd = #{ogCd}
</if>
<if test="ofcCd != null and ofcCd != ''">
and ofc_cd = #{ofcCd}
</if>
</where>
</sql>
<select id="selectUserInfoList" resultType="UserInfo" parameterType="UserInfo">
select user_seq,
user_id,
user_nm,
address,
user_role,
detail_addr,
email,
og_cd,
ofc_cd,
wrt_dt
from user_info
where
<choose>
<when test="userStatus != null and userStatus != ''">
user_status = #{userStatus}
</when>
<otherwise>
user_status != 'D'
</otherwise>
</choose>
<if test="userId != null and userId != ''">
and user_id like '%'||#{userId}||'%'
</if>
<if test="userNm != null and userNm != ''">
and user_nm like '%'||#{userNm}||'%'
</if>
<if test="ogCd != null and ogCd != ''">
and og_cd = #{ogCd}
</if>
<if test="ofcCd != null and ofcCd != ''">
and ofc_cd = #{ofcCd}
</if>
<include refid="selectUserInfoWhere"></include>
order by og_cd, ofc_cd desc
limit #{rowCnt} offset #{firstIndex}
</select>
@ -44,27 +46,7 @@
<select id="selectUserInfoListCnt" resultType="int" parameterType="UserInfo">
select count(*)
from user_info
where
<choose>
<when test="userStatus != null and userStatus != ''">
user_status = #{userStatus}
</when>
<otherwise>
user_status != 'D'
</otherwise>
</choose>
<if test="userId != null and userId != ''">
and user_id like '%'||#{userId}||'%'
</if>
<if test="userNm != null and userNm != ''">
and user_nm like '%'||#{userNm}||'%'
</if>
<if test="ogCd != null and ogCd != ''">
and og_cd = #{ogCd}
</if>
<if test="ofcCd != null and ofcCd != ''">
and ofc_cd = #{ofcCd}
</if>
<include refid="selectUserInfoWhere"></include>
</select>
<select id="selectManagerList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="com.dbnt.faisp.util.ParamMap">