728x90
반응형
SMALL
<choose>
<when test='project_title != "0" and project_title != "1" and project_title != "2" ' >
and P.PROJECT_TITLE=#{project_title}
</when>
<when test='project_title == "1"'>
and P.PROJECT_TITLE IS NULL
</when>
</choose>
풀 sql 문
<!-- 진행중 -->
<select id="getIngMyJobById" resultMap="jobVO" >
SELECT J.ID ,J.DEEP ,J.PROJECT_ID,J.NAME, J.start_date, J.END_DATE ,J.TOTAL_ONE_MD,
J.PLAN_ONE_MD, J.TOTAL_DATE, J.PLAN_DATE, J.MANAGER, J.REAL_START_DATE,
J.REAL_END_DATE, J.REPORT, J.PLAN_PROGRESS, J.REAL_PROGRESS, J.JOB_ID,
J.PRIVACY_STATE,
P.STATE, P.PROJECT_TITLE, P.PROJECT_NICKNAME
FROM JOB J left join PROJECT P on (J.PROJECT_ID =P.ID)
WHERE J.MANAGER = (
SELECT NAME FROM USER U
WHERE U.ID = #{userid}
)and J.PRIVACY_STATE=112
<choose>
<when test='project_title != "0" and project_title != "1" and project_title != "2" ' >
and P.PROJECT_TITLE=#{project_title}
</when>
<when test='project_title == "1"'>
and P.PROJECT_TITLE IS NULL
</when>
</choose>
728x90
반응형
LIST
'SPRING > MyBatis' 카테고리의 다른 글
MyBatis 문자열 및 NULL 비교 처리 (0) | 2021.10.06 |
---|---|
MyBatis resultType vs resultMap 차이점 (0) | 2021.09.09 |
Mybatis 에서의 Map, List, Map<List<Object>> 의 3가지 조회방법 (0) | 2021.09.07 |