Files
zhwl/zhwl-cms/target/classes/mapper/cms/ZdyCmsModelMapper.xml
2025-07-01 17:54:58 +08:00

96 lines
4.1 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.zhwl.cms.mapper.ZdyCmsModelMapper">
<resultMap type="ZdyCmsModel" id="ZdyCmsModelResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="table" column="table" />
<result property="fields" column="fields" />
<result property="channeltpl" column="channeltpl" />
<result property="listtpl" column="listtpl" />
<result property="showtpl" column="showtpl" />
<result property="createtime" column="createtime" />
<result property="updatetime" column="updatetime" />
<result property="setting" column="setting" />
</resultMap>
<sql id="selectZdyCmsModelVo">
select id, name, `table`, fields, channeltpl, listtpl, showtpl, createtime, updatetime, setting from zdy_cms_model
</sql>
<select id="selectZdyCmsModelList" parameterType="ZdyCmsModel" resultMap="ZdyCmsModelResult">
<include refid="selectZdyCmsModelVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="table != null and table != ''"> and table =#{table}</if>
</where>
order by id desc
</select>
<select id="selectZdyCmsModelById" parameterType="Integer" resultMap="ZdyCmsModelResult">
<include refid="selectZdyCmsModelVo"/>
where id = #{id}
</select>
<insert id="insertZdyCmsModel" parameterType="ZdyCmsModel" useGeneratedKeys="true" keyProperty="id">
insert into zdy_cms_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="table != null">`table`,</if>
<if test="fields != null">fields,</if>
<if test="channeltpl != null">channeltpl,</if>
<if test="listtpl != null">listtpl,</if>
<if test="showtpl != null">showtpl,</if>
<if test="createtime != null">createtime,</if>
<if test="updatetime != null">updatetime,</if>
<if test="setting != null">setting,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="table != null">#{table},</if>
<if test="fields != null">#{fields},</if>
<if test="channeltpl != null">#{channeltpl},</if>
<if test="listtpl != null">#{listtpl},</if>
<if test="showtpl != null">#{showtpl},</if>
<if test="createtime != null">#{createtime},</if>
<if test="updatetime != null">#{updatetime},</if>
<if test="setting != null">#{setting},</if>
</trim>
</insert>
<update id="updateZdyCmsModel" parameterType="ZdyCmsModel">
update zdy_cms_model
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="table != null">`table` = #{table},</if>
<if test="fields != null">fields = #{fields},</if>
<if test="channeltpl != null">channeltpl = #{channeltpl},</if>
<if test="listtpl != null">listtpl = #{listtpl},</if>
<if test="showtpl != null">showtpl = #{showtpl},</if>
<if test="createtime != null">createtime = #{createtime},</if>
<if test="updatetime != null">updatetime = #{updatetime},</if>
<if test="setting != null">setting = #{setting},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyCmsModelById" parameterType="Integer">
delete from zdy_cms_model where id = #{id}
</delete>
<delete id="deleteZdyCmsModelByIds" parameterType="String">
delete from zdy_cms_model where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectCounts" resultType="Integer">
select count(0) from ${tableName}
</select>
</mapper>