znpt-backend/core/src/main/resources/mapper/AudioFileInfoMapper.xml

31 lines
1.2 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="com.dite.znpt.mapper.AudioFileInfoMapper">
<sql id="Base_Column_List">
a.audio_id, a.image_id, a.file_path, a.update_by,
a.create_time, a.create_by, a.update_time
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.AudioFileInfoResp">
select
<include refid="Base_Column_List"/>
from audio_file_info a
<where>
<if test="audioId != null and audioId != ''">
and a.audio_id = #{audioId}
</if>
<if test="imageId != null and imageId != ''">
and a.image_id = #{imageId}
</if>
<if test="imageIds != null and imageIds.size() != 0">
and a.image_id in
<foreach collection="imageIds" open="(" close=")" item="imageId" separator=",">
#{imageId}
</foreach>
</if>
</where>
</select>
</mapper>