97 lines
1.9 KiB
XML
97 lines
1.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="io.company.localhost.mapper.commoncodMapper">
|
|
<select id="getWordCategory" resultType="Map">
|
|
select
|
|
CMNCODVAL
|
|
,CMNCODNAM
|
|
from
|
|
commoncod
|
|
where
|
|
CMNCODLV1 = 600
|
|
and
|
|
CMNCODODR != 0
|
|
</select>
|
|
<insert id="insertCategory" parameterType="map">
|
|
INSERT INTO commoncod
|
|
(CMNCODLV1, CMNCODLV2, CMNCODODR, CMNCODVAL, CMNCODNAM, CMNCODYON, CMNCODRDT, CMNCODUDT)
|
|
SELECT
|
|
600
|
|
,IFNULL(MAX(CMNCODLV2), 100) + 1 AS NEXT_CMNCODLV2
|
|
,IFNULL(MAX(CMNCODODR), 0) + 1 AS NEXT_CMNCODODR
|
|
,CONCAT(600, LPAD(IFNULL(MAX(CMNCODLV2), 100) + 1, 3, '0')) AS CMNCODVAL
|
|
,#{CMNCODNAM}
|
|
,'1'
|
|
,NOW()
|
|
,NOW()
|
|
FROM
|
|
commoncod
|
|
WHERE
|
|
CMNCODLV1 = 600;
|
|
</insert>
|
|
|
|
<select id="getColorList" resultType="Map">
|
|
SELECT
|
|
CMNCODVAL
|
|
,CMNCODNAM
|
|
FROM
|
|
commoncod
|
|
WHERE
|
|
CMNCODLV1 = 100
|
|
AND
|
|
CMNCODODR != 0
|
|
AND
|
|
CMNCODYON = 0
|
|
</select>
|
|
|
|
<select id="getMbtiList" resultType="Map">
|
|
SELECT
|
|
CMNCODVAL
|
|
,CMNCODNAM
|
|
FROM
|
|
commoncod
|
|
WHERE
|
|
CMNCODLV1 = 200
|
|
AND
|
|
CMNCODODR != 0
|
|
</select>
|
|
|
|
<select id="getPwhintList" resultType="Map">
|
|
SELECT
|
|
CMNCODVAL
|
|
,CMNCODNAM
|
|
FROM
|
|
commoncod
|
|
WHERE
|
|
CMNCODLV1 = 800
|
|
AND
|
|
CMNCODODR != 0
|
|
</select>
|
|
|
|
<update id="updateColorYon" parameterType="String">
|
|
UPDATE commoncod
|
|
SET CMNCODYON = 1
|
|
WHERE CMNCODVAL = #{color};
|
|
</update>
|
|
|
|
<select id="getCategories" resultType="Map">
|
|
SELECT CMNCODVAL, CMNCODNAM FROM commoncod
|
|
WHERE CMNCODVAL BETWEEN 300101 AND 300103
|
|
</select>
|
|
|
|
<select id="getYearCategories" resultType="Map">
|
|
SELECT
|
|
CMNCODVAL
|
|
,CMNCODNAM
|
|
FROM
|
|
commoncod
|
|
WHERE
|
|
CMNCODLV1 = 900
|
|
AND
|
|
CMNCODODR != 0
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|