357 lines
12 KiB
XML
357 lines
12 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="cn.com.tenlion.materialstore.dao.materialaudio.IMaterialAudioDao">
|
|
|
|
<resultMap id="materialAudioDTO" type="cn.com.tenlion.materialstore.pojo.dtos.materialaudio.MaterialAudioDTO">
|
|
<result column="material_status" property="materialStatus"/>
|
|
<result column="creator_name" property="creatorName"/>
|
|
<result column="material_audio_id" property="materialAudioId"/>
|
|
<result column="material_audio_file_id" property="materialAudioFileId"/>
|
|
<result column="material_id" property="materialId"/>
|
|
<result column="material_order" property="materialOrder"/>
|
|
<result column="material_remark" property="materialRemark"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
<result column="modifier" property="modifier"/>
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
<result column="is_delete" property="isDelete"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="materialAudioBO" type="cn.com.tenlion.materialstore.pojo.bos.materialaudio.MaterialAudioBO">
|
|
<result column="material_audio_id" property="materialAudioId"/>
|
|
<result column="material_audio_file_id" property="materialAudioFileId"/>
|
|
<result column="material_id" property="materialId"/>
|
|
<result column="material_order" property="materialOrder"/>
|
|
<result column="material_remark" property="materialRemark"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
<result column="modifier" property="modifier"/>
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
<result column="is_delete" property="isDelete"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="materialAudioPO" type="cn.com.tenlion.materialstore.pojo.pos.materialaudio.MaterialAudioPO">
|
|
<result column="material_audio_id" property="materialAudioId"/>
|
|
<result column="material_audio_file_id" property="materialAudioFileId"/>
|
|
<result column="material_id" property="materialId"/>
|
|
<result column="material_order" property="materialOrder"/>
|
|
<result column="material_remark" property="materialRemark"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
<result column="modifier" property="modifier"/>
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
<result column="is_delete" property="isDelete"/>
|
|
</resultMap>
|
|
|
|
<!-- 新增音频素材 -->
|
|
<insert id="save" parameterType="map">
|
|
INSERT INTO m_material_audio(
|
|
material_status,
|
|
material_audio_id,
|
|
material_audio_file_id,
|
|
material_id,
|
|
material_order,
|
|
material_remark,
|
|
creator,
|
|
gmt_create,
|
|
modifier,
|
|
gmt_modified,
|
|
is_delete
|
|
) VALUES(
|
|
1,
|
|
#{materialAudioId},
|
|
#{materialAudioFileId},
|
|
#{materialId},
|
|
#{materialOrder},
|
|
#{materialRemark},
|
|
#{creator},
|
|
#{gmtCreate},
|
|
#{modifier},
|
|
#{gmtModified},
|
|
#{isDelete}
|
|
)
|
|
</insert>
|
|
|
|
<!-- 删除音频素材(物理) -->
|
|
<update id="removeByMaterialId" parameterType="map">
|
|
DELETE FROM
|
|
m_material_audio
|
|
WHERE
|
|
material_id = #{materialId}
|
|
</update>
|
|
|
|
<!-- 删除音频素材 -->
|
|
<update id="remove" parameterType="map">
|
|
UPDATE
|
|
m_material_audio
|
|
SET
|
|
gmt_modified = #{gmtModified},
|
|
modifier = #{modifier},
|
|
is_delete = 1
|
|
WHERE
|
|
material_audio_id IN
|
|
<foreach collection="materialAudioIds" index="index" open="(" separator="," close=")">
|
|
#{materialAudioIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 删除音频素材(物理) -->
|
|
<update id="delete" parameterType="map">
|
|
DELETE FROM
|
|
m_material_audio
|
|
WHERE
|
|
material_audio_id IN
|
|
<foreach collection="materialAudioIds" index="index" open="(" separator="," close=")">
|
|
#{materialAudioIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 更改状态 -->
|
|
<update id="updateCheck" parameterType="map">
|
|
UPDATE
|
|
m_material_audio
|
|
SET
|
|
material_status = #{materialStatus}
|
|
WHERE
|
|
material_audio_id = #{materialAudioId}
|
|
</update>
|
|
|
|
<!-- 修改音频素材 -->
|
|
<update id="update" parameterType="map">
|
|
UPDATE
|
|
m_material_audio
|
|
SET
|
|
<if test="materialAudioFileId != null and materialAudioFileId != ''">
|
|
material_audio_file_id = #{materialAudioFileId},
|
|
</if>
|
|
<if test="materialId != null and materialId != ''">
|
|
material_id = #{materialId},
|
|
</if>
|
|
<if test="materialOrder != null">
|
|
material_order = #{materialOrder},
|
|
</if>
|
|
<if test="materialRemark != null and materialRemark != ''">
|
|
material_remark = #{materialRemark},
|
|
</if>
|
|
gmt_modified = #{gmtModified},
|
|
modifier = #{modifier},
|
|
material_audio_id = material_audio_id
|
|
WHERE
|
|
material_audio_id = #{materialAudioId}
|
|
</update>
|
|
|
|
<!-- 音频素材详情 -->
|
|
<select id="get" parameterType="map" resultMap="materialAudioDTO">
|
|
SELECT
|
|
t1.material_audio_file_id,
|
|
t1.material_id,
|
|
t1.material_order,
|
|
t1.material_remark,
|
|
t1.material_audio_id,
|
|
t1.material_status
|
|
FROM
|
|
m_material_audio t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="materialAudioId != null and materialAudioId != ''">
|
|
AND
|
|
t1.material_audio_id = #{materialAudioId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 音频素材详情 -->
|
|
<select id="getBO" parameterType="map" resultMap="materialAudioBO">
|
|
SELECT
|
|
t1.material_audio_id,
|
|
t1.material_audio_file_id,
|
|
t1.material_id,
|
|
t1.material_order,
|
|
t1.material_remark,
|
|
t1.creator,
|
|
t1.gmt_create,
|
|
t1.modifier,
|
|
t1.gmt_modified,
|
|
t1.is_delete
|
|
FROM
|
|
m_material_audio t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="materialAudioId != null and materialAudioId != ''">
|
|
AND
|
|
t1.material_audio_id = #{materialAudioId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 音频素材详情 -->
|
|
<select id="getPO" parameterType="map" resultMap="materialAudioPO">
|
|
SELECT
|
|
t1.material_audio_id,
|
|
t1.material_audio_file_id,
|
|
t1.material_id,
|
|
t1.material_order,
|
|
t1.material_remark,
|
|
t1.creator,
|
|
t1.gmt_create,
|
|
t1.modifier,
|
|
t1.gmt_modified,
|
|
t1.is_delete
|
|
FROM
|
|
m_material_audio t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="materialAudioId != null and materialAudioId != ''">
|
|
AND
|
|
t1.material_audio_id = #{materialAudioId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 音频素材列表 -->
|
|
<select id="list" parameterType="map" resultMap="materialAudioDTO">
|
|
SELECT
|
|
t1.material_audio_id,
|
|
t1.material_audio_file_id,
|
|
t1.material_id,
|
|
t1.material_order,
|
|
t1.material_remark,
|
|
t1.creator,
|
|
t1.gmt_create,
|
|
t1.modifier,
|
|
t1.gmt_modified,
|
|
t1.is_delete,
|
|
t1.material_status,
|
|
t2.user_name AS creator_name
|
|
FROM
|
|
m_material_audio t1
|
|
LEFT JOIN
|
|
sys_user t2
|
|
ON
|
|
t1.creator = t2.user_id
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
<!-- 这里添加其他条件 -->
|
|
t1.material_remark LIKE CONCAT('%', #{keywords}, '%')
|
|
OR
|
|
t2.user_name LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="materialStatus != null and materialStatus != ''">
|
|
AND
|
|
t1.material_status = #{materialStatus}
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="materialAudioIds != null and materialAudioIds.size > 0">
|
|
AND
|
|
t1.material_audio_id IN
|
|
<foreach collection="materialAudioIds" index="index" open="(" separator="," close=")">
|
|
#{materialAudioIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
<if test="materialId != '' and materialId != null">
|
|
AND t1.material_id = #{materialId}
|
|
</if>
|
|
<if test="creator != '' and creator != null">
|
|
AND t1.creator = #{creator}
|
|
</if>
|
|
ORDER BY t1.gmt_create DESC, t1.material_order
|
|
</select>
|
|
|
|
<!-- 音频素材列表 -->
|
|
<select id="listBO" parameterType="map" resultMap="materialAudioBO">
|
|
SELECT
|
|
t1.material_audio_id,
|
|
t1.material_audio_file_id,
|
|
t1.material_id,
|
|
t1.material_order,
|
|
t1.material_remark,
|
|
t1.creator,
|
|
t1.gmt_create,
|
|
t1.modifier,
|
|
t1.gmt_modified,
|
|
t1.is_delete
|
|
FROM
|
|
m_material_audio t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
<!-- 这里添加其他条件 -->
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="materialAudioIds != null and materialAudioIds.size > 0">
|
|
AND
|
|
t1.material_audio_id IN
|
|
<foreach collection="materialAudioIds" index="index" open="(" separator="," close=")">
|
|
#{materialAudioIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 音频素材列表 -->
|
|
<select id="listPO" parameterType="map" resultMap="materialAudioPO">
|
|
SELECT
|
|
t1.material_audio_id,
|
|
t1.material_audio_file_id,
|
|
t1.material_id,
|
|
t1.material_order,
|
|
t1.material_remark,
|
|
t1.creator,
|
|
t1.gmt_create,
|
|
t1.modifier,
|
|
t1.gmt_modified,
|
|
t1.is_delete
|
|
FROM
|
|
m_material_audio t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
<!-- 这里添加其他条件 -->
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="materialAudioIds != null and materialAudioIds.size > 0">
|
|
AND
|
|
t1.material_audio_id IN
|
|
<foreach collection="materialAudioIds" index="index" open="(" separator="," close=")">
|
|
#{materialAudioIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 音频素材统计 -->
|
|
<select id="count" parameterType="map" resultType="Integer">
|
|
SELECT
|
|
COUNT(*)
|
|
FROM
|
|
m_material_audio t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
</select>
|
|
|
|
</mapper> |