zhwl/zhwl-business/zhwl-printset/target/classes/mapper/ZdyPrintModuleMapper.xml

197 lines
7.0 KiB
XML
Raw Normal View History

2025-07-01 17:54:58 +08: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.zhwl.printset.mapper.ZdyPrintModuleMapper">
<resultMap type="ZdyPrintModule" id="ZdyPrintModuleResult">
<result property="id" column="id"/>
<result property="scenicId" column="scenic_id"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="table" column="table"/>
<result property="field" column="field"/>
<result property="fieldType" column="field_type"/>
<result property="dictType" column="dict_type"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="imageUrl" column="image_url"/>
<result property="sort" column="sort"/>
<result property="eateryType" column="eatery_type"/>
<result property="statisticType" column="statistic_type"/>
</resultMap>
<sql id="selectZdyPrintModuleVo">
select zpm.id, scenic_id, zpm.name, zpm.type, category, `table`, field, field_type, dict_type, zpm.create_time,
zpm.update_time, image_url, sort, eatery_type, statistic_type
from zdy_print_module zpm
</sql>
<select id="selectZdyPrintModuleList" parameterType="ZdyPrintModule" resultMap="ZdyPrintModuleResult">
<include refid="selectZdyPrintModuleVo"/>
LEFT JOIN zdy_scenic zs ON zs.id = zpm.scenic_id
LEFT JOIN sys_dept d ON d.dept_id = zs.dept_id
<where>
<if test="scenicId != null ">
and scenic_id = #{scenicId}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="type != null ">
and type = #{type}
</if>
<if test="category != null ">
and category = #{category}
</if>
<if test="table != null and table != ''">
and table = #{table}
</if>
<if test="fieldType != null and fieldType != ''">
and field_type = #{fieldType}
</if>
${params.dataScope}
</where>
order by sort
</select>
<select id="selectZdyPrintModuleById" parameterType="Integer"
resultMap="ZdyPrintModuleResult">
<include refid="selectZdyPrintModuleVo"/>
where id = #{id}
</select>
<select id="selectOrderInfo" resultType="java.lang.Object">
select ${field} from ${table}
where id = #{orderId}
</select>
<select id="selectJsonArray" resultType="com.alibaba.fastjson2.JSONObject">
select ${field} from ${table}
where order_id = #{orderId}
</select>
<insert id="insertZdyPrintModule" parameterType="ZdyPrintModule" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_print_module
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="scenicId != null">scenic_id,
</if>
<if test="name != null and name != ''">name,
</if>
<if test="type != null">type,
</if>
<if test="category != null">category,
</if>
<if test="table != null">table,
</if>
<if test="field != null">field,
</if>
<if test="fieldType != null">field_type,
</if>
<if test="dictType != null">dict_type,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="imageUrl != null">image_url,
</if>
<if test="sort != null">sort,
</if>
<if test="eateryType != null">eatery_type,
</if>
<if test="statisticType != null">statistic_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="scenicId != null">#{scenicId},
</if>
<if test="name != null and name != ''">#{name},
</if>
<if test="type != null">#{type},
</if>
<if test="category != null">#{category},
</if>
<if test="table != null">#{table},
</if>
<if test="field != null">#{field},
</if>
<if test="fieldType != null">#{fieldType},
</if>
<if test="dictType != null">#{dictType},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="imageUrl != null">#{imageUrl},
</if>
<if test="sort != null">#{sort},
</if>
<if test="eateryType != null">#{eateryType},
</if>
<if test="statisticType != null">#{statisticType},
</if>
</trim>
</insert>
<update id="updateZdyPrintModule" parameterType="ZdyPrintModule">
update zdy_print_module
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">`name` =
#{name},
</if>
<if test="type != null">`type` =
#{type},
</if>
<if test="category != null">category =
#{category},
</if>
<if test="table != null">`table` =
#{table},
</if>
<if test="field != null">`field` =
#{field},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="imageUrl != null">image_url =
#{imageUrl},
</if>
<if test="fieldType != null">field_type =
#{fieldType},
</if>
<if test="dictType != null">dict_type =
#{dictType},
</if>
<if test="sort != null">sort =
#{sort},
</if>
<if test="eateryType != null">eatery_type =
#{eateryType},
</if>
<if test="statisticType != null">statistic_type =
#{statisticType},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyPrintModuleById" parameterType="Integer">
delete
from zdy_print_module
where id = #{id}
</delete>
<delete id="deleteZdyPrintModuleByIds" parameterType="String">
delete from zdy_print_module where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>