Files
intc-cloud/intc-modules/intc-collect/src/main/resources/mapper/collect/CommemorativeCoinMapper.xml
2026-02-22 16:53:47 +08:00

191 lines
10 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.intc.collect.mapper.CommemorativeCoinMapper">
<resultMap type="CommemorativeCoinVo" id="CommemorativeCoinResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="fullName" column="full_name" />
<result property="shortName" column="short_name" />
<result property="faceValue" column="face_value" />
<result property="issueDate" column="issue_date" />
<result property="issueYear" column="issue_year" />
<result property="series" column="series" />
<result property="setNumber" column="set_number" />
<result property="blockType" column="block_type" />
<result property="shape" column="shape" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="mintage" column="mintage" />
<result property="composition" column="composition" />
<result property="weight" column="weight" />
<result property="dimension" column="dimension" />
<result property="thickness" column="thickness" />
<result property="coinTeeth" column="coin_teeth" />
</resultMap>
<resultMap id="CommemorativeCoinCollectFileResult" type="CommemorativeCoinVo" extends="CommemorativeCoinResult">
<collection property="collectFileList" notNullColumn="sub_id" javaType="java.util.List" resultMap="CollectFileResult" />
</resultMap>
<resultMap type="CollectFileVo" id="CollectFileResult">
<result property="id" column="sub_id" />
<result property="collectId" column="sub_collect_id" />
<result property="catelog" column="sub_catelog" />
<result property="fileName" column="sub_file_name" />
<result property="name" column="sub_name" />
<result property="createTime" column="sub_create_time" />
<result property="createBy" column="sub_create_by" />
<result property="url" column="sub_url" />
</resultMap>
<sql id="selectCommemorativeCoinVo">
select a.id, a.type, a.full_name, a.short_name, a.face_value, a.issue_date,a.mintage,a.composition,
a.issue_year, a.series, a.set_number, a.block_type, a.shape, a.create_by,
a.create_time, a.update_by, a.update_time, a.del_flag, a.remark,
a.weight, a.dimension, a.thickness, a.coin_teeth,
b.id as sub_id, b.collect_id as sub_collect_id, b.catelog as sub_catelog, b.file_name as sub_file_name,
b.name as sub_name, b.create_by as sub_create_by, b.create_time as sub_create_time, b.url as sub_url
from col_commemorative_coin a
left join col_collect_file b on b.collect_id=a.id
</sql>
<select id="selectCommemorativeCoinList" parameterType="CommemorativeCoinDto" resultMap="CommemorativeCoinCollectFileResult">
<include refid="selectCommemorativeCoinVo"/>
<where>
a.del_flag='0'
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="fullName != null and fullName != ''"> and a.full_name like '%'|| #{fullName}||'%'</if>
<if test="name != null and name != ''"> and (a.short_name like '%'|| #{name}||'%' or a.full_name like '%'|| #{name}||'%') </if>
<if test="issueDate != null "> and a.issue_date = #{issueDate}</if>
<if test="issueYear != null and issueYear != ''"> and a.issue_year like '%'|| #{issueYear}||'%'</if>
<if test="series != null and series != ''"> and a.series = #{series}</if>
<if test="blockType != null and blockType != ''"> and a.block_type = #{blockType}</if>
<if test="shape != null and shape != ''"> and a.shape = #{shape}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.issue_date, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.issue_date, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
order by a.issue_date desc
</select>
<select id="selectCommemorativeCoinById" parameterType="Long" resultMap="CommemorativeCoinCollectFileResult">
<include refid="selectCommemorativeCoinVo"/>
where a.id = #{id}
</select>
<insert id="insertCommemorativeCoin" parameterType="CommemorativeCoin">
insert into col_commemorative_coin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="type != null and type != ''">type,</if>
<if test="fullName != null and fullName != ''">full_name,</if>
<if test="shortName != null and shortName != ''">short_name,</if>
<if test="faceValue != null and faceValue != ''">face_value,</if>
<if test="issueDate != null">issue_date,</if>
<if test="issueYear != null and issueYear != ''">issue_year,</if>
<if test="series != null and series != ''">series,</if>
<if test="setNumber != null">set_number,</if>
<if test="blockType != null">block_type,</if>
<if test="shape != null and shape != ''">shape,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="mintage != null">mintage,</if>
<if test="composition != null">composition,</if>
<if test="weight != null">weight,</if>
<if test="dimension != null">dimension,</if>
<if test="thickness != null">thickness,</if>
<if test="coinTeeth != null">coin_teeth,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="fullName != null and fullName != ''">#{fullName},</if>
<if test="shortName != null and shortName != ''">#{shortName},</if>
<if test="faceValue != null and faceValue != ''">#{faceValue},</if>
<if test="issueDate != null">#{issueDate},</if>
<if test="issueYear != null and issueYear != ''">#{issueYear},</if>
<if test="series != null and series != ''">#{series},</if>
<if test="setNumber != null">#{setNumber},</if>
<if test="blockType != null">#{blockType},</if>
<if test="shape != null and shape != ''">#{shape},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="mintage != null">#{mintage},</if>
<if test="composition != null">#{composition},</if>
<if test="weight != null">#{weight},</if>
<if test="dimension != null">#{dimension},</if>
<if test="thickness != null">#{thickness},</if>
<if test="coinTeeth != null">#{coinTeeth},</if>
</trim>
</insert>
<update id="updateCommemorativeCoin" parameterType="CommemorativeCoin">
update col_commemorative_coin
<trim prefix="SET" suffixOverrides=",">
<if test="type != null and type != ''">type = #{type},</if>
<if test="fullName != null and fullName != ''">full_name = #{fullName},</if>
<if test="shortName != null and shortName != ''">short_name = #{shortName},</if>
<if test="faceValue != null and faceValue != ''">face_value = #{faceValue},</if>
<if test="issueDate != null">issue_date = #{issueDate},</if>
<if test="issueYear != null and issueYear != ''">issue_year = #{issueYear},</if>
<if test="series != null and series != ''">series = #{series},</if>
<if test="setNumber != null">set_number = #{setNumber},</if>
<if test="blockType != null">block_type = #{blockType},</if>
<if test="shape != null and shape != ''">shape = #{shape},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="mintage != null">mintage = #{mintage},</if>
<if test="composition != null">composition = #{composition},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="dimension != null">dimension = #{dimension},</if>
<if test="thickness != null">thickness = #{thickness},</if>
<if test="coinTeeth != null">coin_teeth = #{coinTeeth},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCommemorativeCoinById" parameterType="Long">
delete from col_commemorative_coin where id = #{id}
</delete>
<delete id="deleteCommemorativeCoinByIds" parameterType="String">
delete from col_commemorative_coin where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeCommemorativeCoinById" parameterType="Long">
update col_commemorative_coin set del_flag='1' where id = #{id}
</update>
<update id="removeCommemorativeCoinByIds" parameterType="String">
update col_commemorative_coin set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>