FAISP/src/main/resources/mybatisMapper/UserInfoMapper.xml

69 lines
1.8 KiB
XML
Raw Normal View History

2022-08-18 06:21:44 +00:00
<?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">
2022-08-23 02:34:25 +00:00
<mapper namespace="com.dbnt.faisp.userInfo.mapper.UserInfoMapper">
2022-08-18 06:21:44 +00:00
<select id="selectUserInfoList" resultType="UserInfo" parameterType="UserInfo">
2022-08-25 09:39:21 +00:00
select user_seq,
user_id,
user_nm,
address,
user_role,
2022-08-25 09:39:21 +00:00
detail_addr,
email,
og_cd,
ofc_cd,
wrt_dt
from user_info
2022-08-30 02:57:53 +00:00
where
<choose>
<when test="userStatus != null and userStatus != ''">
user_status = #{userStatus}
</when>
<otherwise>
user_status != 'D'
</otherwise>
</choose>
2022-08-25 09:39:21 +00:00
<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>
order by og_cd, ofc_cd desc
limit #{rowCnt} offset #{firstIndex}
2022-08-18 06:21:44 +00:00
</select>
<select id="selectUserInfoListCnt" resultType="int" parameterType="UserInfo">
2022-08-25 09:39:21 +00:00
select count(*)
from user_info
where
<choose>
<when test="userStatus != null and userStatus != ''">
user_status = #{userStatus}
</when>
<otherwise>
user_status != 'D'
</otherwise>
</choose>
2022-08-25 09:39:21 +00:00
<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>
2022-08-18 06:21:44 +00:00
</select>
</mapper>