123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?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.ruoyi.rc.mapper.TChapMapper">
-
- <resultMap type="TChap" id="TChapResult">
- <result property="id" column="id" />
- <result property="auditId" column="audit_id" />
- <result property="name" column="name" />
- <result property="deptId" column="dept_id" />
- </resultMap>
- <sql id="selectTChapVo">
- select id, audit_id, name, dept_id from t_chap
- </sql>
- <select id="selectTChapList" parameterType="TChap" resultMap="TChapResult">
- <include refid="selectTChapVo"/>
- <where>
- <if test="auditId != null "> and audit_id = #{auditId}</if>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="deptId != null "> and dept_id like concat(concat('%', #{deptId}), '%')</if>
- </where>
- </select>
-
- <select id="selectTChapById" parameterType="Long" resultMap="TChapResult">
- <include refid="selectTChapVo"/>
- where id = #{id}
- </select>
- <insert id="insertTChap" parameterType="TChap" useGeneratedKeys="true" keyProperty="id">
- insert into t_chap
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="auditId != null">audit_id,</if>
- <if test="name != null">name,</if>
- <if test="deptId != null">dept_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="auditId != null">#{auditId},</if>
- <if test="name != null">#{name},</if>
- <if test="deptId != null">#{deptId},</if>
- </trim>
- </insert>
- <update id="updateTChap" parameterType="TChap">
- update t_chap
- <trim prefix="SET" suffixOverrides=",">
- <if test="auditId != null">audit_id = #{auditId},</if>
- <if test="name != null">name = #{name},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTChapById" parameterType="Long">
- delete from t_chap where id = #{id}
- </delete>
- <delete id="deleteTChapByIds" parameterType="String">
- delete from t_chap where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|