ganzi-api/inventory-dao/src/main/resources/mapper/SysStatuteDescMapper.xml

254 lines
9.0 KiB
XML
Raw Normal View History

2022-09-16 15:07:17 +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.rzyc.mapper.SysStatuteDescMapper">
<resultMap id="BaseResultMap" type="com.rzyc.model.SysStatuteDesc">
<result column="desc_id" jdbcType="VARCHAR" property="descId" />
<result column="statute_id" jdbcType="VARCHAR" property="statuteId" />
<result column="modified" jdbcType="VARCHAR" property="modified" />
<result column="created" jdbcType="VARCHAR" property="created" />
<result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.rzyc.model.SysStatuteDesc">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
desc_id, statute_id, modified, created, modify_time, create_time
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.rzyc.model.SysStatuteDescExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_statute_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.rzyc.model.SysStatuteDescExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_statute_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<delete id="deleteByExample" parameterType="com.rzyc.model.SysStatuteDescExample">
delete from sys_statute_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.rzyc.model.SysStatuteDesc">
insert into sys_statute_desc (desc_id, statute_id, modified,
created, modify_time, create_time,
content)
values (#{descId,jdbcType=VARCHAR}, #{statuteId,jdbcType=VARCHAR}, #{modified,jdbcType=VARCHAR},
#{created,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.rzyc.model.SysStatuteDesc">
insert into sys_statute_desc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="descId != null">
desc_id,
</if>
<if test="statuteId != null">
statute_id,
</if>
<if test="modified != null">
modified,
</if>
<if test="created != null">
created,
</if>
<if test="modifyTime != null">
modify_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="descId != null">
#{descId,jdbcType=VARCHAR},
</if>
<if test="statuteId != null">
#{statuteId,jdbcType=VARCHAR},
</if>
<if test="modified != null">
#{modified,jdbcType=VARCHAR},
</if>
<if test="created != null">
#{created,jdbcType=VARCHAR},
</if>
<if test="modifyTime != null">
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.rzyc.model.SysStatuteDescExample" resultType="java.lang.Long">
select count(*) from sys_statute_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_statute_desc
<set>
<if test="record.descId != null">
desc_id = #{record.descId,jdbcType=VARCHAR},
</if>
<if test="record.statuteId != null">
statute_id = #{record.statuteId,jdbcType=VARCHAR},
</if>
<if test="record.modified != null">
modified = #{record.modified,jdbcType=VARCHAR},
</if>
<if test="record.created != null">
created = #{record.created,jdbcType=VARCHAR},
</if>
<if test="record.modifyTime != null">
modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update sys_statute_desc
set desc_id = #{record.descId,jdbcType=VARCHAR},
statute_id = #{record.statuteId,jdbcType=VARCHAR},
modified = #{record.modified,jdbcType=VARCHAR},
created = #{record.created,jdbcType=VARCHAR},
modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_statute_desc
set desc_id = #{record.descId,jdbcType=VARCHAR},
statute_id = #{record.statuteId,jdbcType=VARCHAR},
modified = #{record.modified,jdbcType=VARCHAR},
created = #{record.created,jdbcType=VARCHAR},
modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<!--章节内容-->
<select id="findByStatuteId" resultMap="ResultMapWithBLOBs">
SELECT * FROM `sys_statute_desc` td WHERE td.`statute_id` = #{statuteId}
</select>
<!--修改章节内容-->
<update id="changeStatuteDesc">
update sys_statute_desc
set content = #{record.content,jdbcType=LONGVARCHAR}
where statute_id = #{record.statuteId,jdbcType=VARCHAR}
</update>
</mapper>