앱)mysql sequence 쿼리 샘플
<select id="makeSequence" parameterType="map" resultType="String">
SELECT CONCAT(LPAD(CAST(CAST(RAND()*1000 AS UNSIGNED) AS CHAR), 3, '0'), DATE_FOMAT(NOW(), '%Y%m%d'), "-", 'J', #{XXX}, LPAD(CAST(CAST(RAND()*1000000000 AS UNSIGNED) AS CHAR),8,'0'))
</select>
SELECT CONCAT(LPAD(CAST(CAST(RAND()*1000 AS UNSIGNED) AS CHAR), 3, '0'), DATE_FOMAT(NOW(), '%Y%m%d'), "-", 'J', #{XXX}, LPAD(CAST(CAST(RAND()*1000000000 AS UNSIGNED) AS CHAR),8,'0'))
</select>
'백엔드개발 > 자바스프링' 카테고리의 다른 글
앱)mybatis resultMap과 resultType 차이 (0) | 2018.11.14 |
---|---|
앱)select box 선택시에 팝업이 뜨는 로직정리 (0) | 2018.11.14 |
앱)mybatis config.xml (0) | 2018.11.14 |
앱)spring transaction properties mybatis Config설정 예시 샘플 (0) | 2018.11.08 |
앱)자바 enum 예제 (0) | 2018.07.09 |