天天看點

sql ibatis

<!-- 寫入機關下目前參保人員 -->
    <insert id="insertTempCaz043" parameterClass="map">
        INSERT INTO TEMP_CAZ043 (AAC001,
                                 HDID,
                                 aae001,
                                 cab623
                                 )
                 SELECT DISTINCT a.AAC001,
                                 #hdid#,
                                 #aae001#,
                                 #cab623#
                            FROM AC02 a, ac01 b
                           WHERE A.AAB001 = #aab001#
                             AND A.AAC001 = B.AAC001
                             AND B.AAC084 = '0'
                             AND A.AAC008 = '1'  <!-- 正常參保 -->
                             AND A.AAE042 IS NULL
    </insert>      
sql