You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
4.3 KiB
XML
121 lines
4.3 KiB
XML
<?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="go.kr.project.crdn.exmnr.mapper.ExmnrMapper">
|
|
|
|
<!-- 조사원 목록 조회 -->
|
|
<select id="selectList" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO" resultType="go.kr.project.crdn.exmnr.model.ExmnrVO">
|
|
/* ExmnrMapper.selectList : 조사원 목록 조회 */
|
|
SELECT
|
|
e.EXMNR_ID,
|
|
e.SGG_CD,
|
|
sgg.CD_NM AS SGG_CD_NM,
|
|
e.REG_DT,
|
|
e.RGTR,
|
|
e.DEL_YN,
|
|
e.DEL_DT,
|
|
e.DLTR,
|
|
e.EXMNR,
|
|
u.USER_ACNT AS RGTR_ACNT,
|
|
u.USER_NM AS RGTR_NM
|
|
FROM tb_exmnr e
|
|
LEFT JOIN tb_cd_detail sgg ON sgg.CD_GROUP_ID = 'ORG_CD' AND sgg.CD_ID = e.SGG_CD AND sgg.USE_YN = 'Y'
|
|
LEFT JOIN tb_user u ON u.USER_ID = e.RGTR AND u.USE_YN = 'Y'
|
|
WHERE e.DEL_YN = 'N'
|
|
<if test='schExmnrId != null and schExmnrId != ""'>
|
|
AND e.EXMNR_ID = #{schExmnrId}
|
|
</if>
|
|
<if test='schExmnr != null and schExmnr != ""'>
|
|
AND e.EXMNR LIKE CONCAT('%', #{schExmnr}, '%')
|
|
</if>
|
|
ORDER BY e.EXMNR_ID ASC
|
|
<if test='pagingYn != null and pagingYn == "Y"'>
|
|
limit #{startIndex}, #{perPage} /* 서버사이드 페이징 처리 */
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 조사원 목록 총 개수 조회 -->
|
|
<select id="selectListTotalCount" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO" resultType="int">
|
|
/* ExmnrMapper.selectListTotalCount : 조사원 목록 총 개수 조회 */
|
|
SELECT COUNT(*)
|
|
FROM tb_exmnr e
|
|
WHERE e.DEL_YN = 'N'
|
|
<if test='schExmnrId != null and schExmnrId != ""'>
|
|
AND e.EXMNR_ID = #{schExmnrId}
|
|
</if>
|
|
<if test='schExmnr != null and schExmnr != ""'>
|
|
AND e.EXMNR LIKE CONCAT('%', #{schExmnr}, '%')
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 조사원 단건 조회 -->
|
|
<select id="selectOne" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO" resultType="go.kr.project.crdn.exmnr.model.ExmnrVO">
|
|
/* ExmnrMapper.selectOne : 조사원 단건 조회 */
|
|
SELECT
|
|
e.EXMNR_ID,
|
|
e.SGG_CD,
|
|
sgg.CD_NM AS SGG_CD_NM,
|
|
e.REG_DT,
|
|
e.RGTR,
|
|
e.DEL_YN,
|
|
e.DEL_DT,
|
|
e.DLTR,
|
|
e.EXMNR,
|
|
u.USER_ACNT AS RGTR_ACNT,
|
|
u.USER_NM AS RGTR_NM
|
|
FROM tb_exmnr e
|
|
LEFT JOIN tb_cd_detail sgg ON sgg.CD_GROUP_ID = 'ORG_CD' AND sgg.CD_ID = e.SGG_CD AND sgg.USE_YN = 'Y'
|
|
LEFT JOIN tb_user u ON u.USER_ID = e.RGTR AND u.USE_YN = 'Y'
|
|
WHERE e.DEL_YN = 'N'
|
|
AND e.EXMNR_ID = #{exmnrId}
|
|
</select>
|
|
|
|
<!-- 조사원 등록 -->
|
|
<insert id="insert" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO">
|
|
/* ExmnrMapper.insert : 조사원 등록 */
|
|
INSERT INTO tb_exmnr (
|
|
EXMNR_ID,
|
|
SGG_CD,
|
|
REG_DT,
|
|
RGTR,
|
|
DEL_YN,
|
|
EXMNR
|
|
) VALUES (
|
|
LPAD(NEXTVAL(seq_exmnr_id), 10, '0'),
|
|
#{sggCd},
|
|
NOW(),
|
|
#{rgtr},
|
|
'N',
|
|
#{exmnr}
|
|
)
|
|
</insert>
|
|
|
|
<!-- 조사원 수정 -->
|
|
<update id="update" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO">
|
|
/* ExmnrMapper.update : 조사원 수정 */
|
|
UPDATE tb_exmnr
|
|
SET EXMNR = #{exmnr}
|
|
WHERE EXMNR_ID = #{exmnrId}
|
|
AND DEL_YN = 'N'
|
|
</update>
|
|
|
|
<!-- 조사원 삭제 -->
|
|
<update id="delete" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO">
|
|
/* ExmnrMapper.delete : 조사원 삭제 */
|
|
UPDATE tb_exmnr
|
|
SET DEL_YN = 'Y',
|
|
DEL_DT = NOW(),
|
|
DLTR = #{dltr}
|
|
WHERE EXMNR_ID = #{exmnrId}
|
|
AND DEL_YN = 'N'
|
|
</update>
|
|
|
|
<!-- 조사원번호 중복 체크 -->
|
|
<select id="selectDuplicateCheck" parameterType="go.kr.project.crdn.exmnr.model.ExmnrVO" resultType="int">
|
|
/* ExmnrMapper.selectDuplicateCheck : 조사원번호 중복 체크 */
|
|
SELECT COUNT(*)
|
|
FROM tb_exmnr
|
|
WHERE EXMNR_ID = #{exmnrId}
|
|
</select>
|
|
|
|
</mapper> |