<!-- SqlSession setup for MyBatis Database Layer -->
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:/egovframework/sqlmap/config/sql-mapper-config.xml" />
<property name="mapperLocations" value="classpath:/egovframework/sqlmap/mappers/mapper_*.xml" />
</bean>
select *
from TB_COMM_USER
<where>
1 = 1
and USER_GB = 'M'
<if test="userId != null and !userId.equals('') ">
and
USER_ID like concat('%', #{userId}, '%')
</if>
<if test="hpNum != null and !hpNum.equals('') ">
and
HP_NUM like concat('%', #{hpNum}, '%')
</if>
<if test="apprYn != null and !apprYn.equals('') ">
and
APPR_YN like concat('%',
#{apprYn}, '%')
</if>
<if test="startDate != null and !startDate.equals('')">
and
REG_DTM >= date(#{startDate})
</if>
<if test ="endDate != null and !endDate.equals('') ">
and
<![CDATA[REG_DTM <= date(#{endDate})+1 ]]>
</if>
</where>
group by
USER_SEQ;