veve-batch-material/target/classes/mapper/ContentMapper.xml

51 lines
1.5 KiB
XML
Raw Normal View History

2025-07-21 04:43:14 +00:00
<?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="com.veve_plus.root.mapper.ContentMapper">
<update id="mapContent">
UPDATE tb_content
SET tms_id = #{tmsId}
WHERE content = #{content}
</update>
<update id="unMapContent">
UPDATE tb_content
SET tms_id = NULL
WHERE content = #{content}
</update>
<insert id="insertContent" parameterType="com.veve_plus.root.entity.Content">
INSERT INTO tb_content (
content,
del_yn,
tms_id,
created_by,
updated_by,
created_time,
updated_time
)
SELECT
#{content},
#{locale},
#{tmsId},
#{createdBy},
#{updatedBy},
#{createdTime},
#{updatedTime}
WHERE NOT EXISTS (
SELECT *
FROM tb_content
WHERE content = #{content}
)
</insert>
<select id="listContent" resultType="com.veve_plus.root.dto.content.ContentDto">
SELECT tc.idx
, tc.content
, tc.tms_id AS tmsId
, ttp.title AS tmsTitle
FROM tb_content tc
LEFT JOIN tb_tms_project ttp
ON tc.tms_id = ttp.project_id
ORDER BY ttp.title, tc.content
</select>
</mapper>