Pages

2014년 2월 18일 화요일

[SPRING] Spring mvc에서 Quartz 적용하기 - (4)

- getList만 사용한다. USE_FLAG가 "Y"인 놈만 가져오게 사용할것이다.

001<?xml version="1.0" encoding="UTF-8" ?>
002<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
003<sqlMap namespace="kr.kangwoo.postman.repository.MailTemplateDao" >
004     
005    <resultMap id="MailTemplate" class="kr.kangwoo.postman.domain.MailTemplate" >
006        <result column="TEMPLATE_ID" property="templateId" jdbcType="CHAR" />
007        <result column="TEMPLATE_DIR" property="templateDir" jdbcType="VARCHAR2" />
008        <result column="TEMPLATE_FILENAME" property="templateFilename" jdbcType="VARCHAR2"/>
009        <result column="MAIL_SUBJECT" property="mailSubject" jdbcType="VARCHAR2" />
010        <result column="DATA_MODEL_TYPE" property="dataModelType" jdbcType="CHAR" />
011        <result column="USE_FLAG" property="useFlag" jdbcType="CHAR" />
012        <result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR2" />
013        <result column="CREATION_DATE" property="creationDate" jdbcType="DATETIME" />
014        <result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR2" />
015        <result column="UPDATED_DATE" property="updatedDate" jdbcType="DATETIME" />
016    </resultMap>
017     
018    <insert id="insert" parameterClass="kr.kangwoo.postman.domain.MailTemplate" >
019        insert into MAIL_TEMPLATE (TEMPLATE_ID, TEMPLATE_DIR, TEMPLATE_FILENAME, MAIL_SUBJECT,
020        DATA_MODEL_TYPE, USE_FLAG, CREATED_BY, CREATION_DATE, UPDATED_BY, UPDATED_DATE)
021        values (#templateId:CHAR#, #templateDir:VARCHAR2#, #templateFilename:VARCHAR2#,
022        #mailSubject:VARCHAR2#, #dataModelType:CHAR#, #useFlag:CHAR#, #createdBy:VARCHAR2#,
023        #creationDate:DATETIME#, #updatedBy:VARCHAR2#, #updatedDate:DATETIME#)
024    </insert>
025     
026    <update id="update" parameterClass="kr.kangwoo.postman.domain.MailTemplate" >
027        update MAIL_TEMPLATE
028        set TEMPLATE_DIR = #templateDir:VARCHAR2#,
029            TEMPLATE_FILENAME = #templateFilename:VARCHAR2#,
030            MAIL_SUBJECT = #mailSubject:VARCHAR2#,
031            DATA_MODEL_TYPE = #dataModelType:CHAR#,
032            USE_FLAG = #useFlag:CHAR#,
033            CREATED_BY = #createdBy:VARCHAR2#,
034            CREATION_DATE = #creationDate:DATETIME#,
035            UPDATED_BY = #updatedBy:VARCHAR2#,
036            UPDATED_DATE = #updatedDate:DATETIME#
037        where TEMPLATE_ID = #templateId:CHAR#
038    </update>
039     
040    <update id="updateSelective" parameterClass="kr.kangwoo.postman.domain.MailTemplate" >
041        update MAIL_TEMPLATE
042        <dynamic prepend="set" >
043            <isNotNull prepend="," property="templateDir" >
044                    TEMPLATE_DIR = #templateDir:VARCHAR2#
045            </isNotNull>
046            <isNotNull prepend="," property="templateFilename" >
047                    TEMPLATE_FILENAME = #templateFilename:VARCHAR2#
048            </isNotNull>
049            <isNotNull prepend="," property="mailSubject" >
050                    MAIL_SUBJECT = #mailSubject:VARCHAR2#
051            </isNotNull>
052            <isNotNull prepend="," property="dataModelType" >
053                    DATA_MODEL_TYPE = #dataModelType:CHAR#
054            </isNotNull>
055            <isNotNull prepend="," property="useFlag" >
056                    USE_FLAG = #useFlag:CHAR#
057            </isNotNull>
058            <isNotNull prepend="," property="createdBy" >
059                    CREATED_BY = #createdBy:VARCHAR2#
060            </isNotNull>
061            <isNotNull prepend="," property="creationDate" >
062                    CREATION_DATE = #creationDate:DATETIME#
063            </isNotNull>
064            <isNotNull prepend="," property="updatedBy" >
065                    UPDATED_BY = #updatedBy:VARCHAR2#
066            </isNotNull>
067            <isNotNull prepend="," property="updatedDate" >
068                    UPDATED_DATE = #updatedDate:DATETIME#
069            </isNotNull>
070        </dynamic>
071        where TEMPLATE_ID = #templateId:CHAR#
072    </update>
073     
074    <delete id="delete" parameterClass="kr.kangwoo.postman.domain.MailTemplate" >
075        delete from MAIL_TEMPLATE
076        where TEMPLATE_ID = #templateId:CHAR#
077    </delete>
078     
079    <select id="getMailTemplate" parameterClass="kr.kangwoo.postman.domain.MailTemplate" resultMap="MailTemplate" >
080        select TEMPLATE_ID, TEMPLATE_DIR, TEMPLATE_FILENAME, MAIL_SUBJECT, DATA_MODEL_TYPE, USE_FLAG,
081        CREATED_BY, CREATION_DATE, UPDATED_BY, UPDATED_DATE
082        from MAIL_TEMPLATE
083        where TEMPLATE_ID = #templateId:CHAR#
084    </select>
085     
086    <select id="getList" parameterClass="java.util.Map" resultMap="MailTemplate" >
087        select TEMPLATE_ID, TEMPLATE_DIR, TEMPLATE_FILENAME, MAIL_SUBJECT, DATA_MODEL_TYPE, USE_FLAG,
088        CREATED_BY, CREATION_DATE, UPDATED_BY, UPDATED_DATE
089        from MAIL_TEMPLATE
090        <dynamic prepend="where" >
091            <isNotNull prepend="," property="useFlag" >
092                    USE_FLAG = #useFlag:CHAR#
093            </isNotNull>
094        </dynamic>
095    </select>
096     
097    <select id="count" parameterClass="java.util.Map" resultClass="java.lang.Integer" >
098        select count(*) cnt from MAIL_TEMPLATE
099    </select>
100</sqlMap>

댓글 없음:

댓글 쓰기