123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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.sy.mapper.SyVocationalMapper">
-
- <resultMap type="SyVocational" id="SyVocationalResult">
- <result property="id" column="id" />
- <result property="code" column="code" />
- <result property="parentCode" column="parent_code" />
- <result property="name" column="name" />
- <result property="level" column="level" />
- <result property="createTime" column="create_time" />
- <result property="ancestors" column="ancestors" />
- <result property="childCount" column="child_count" />
- <result property="grandchildCount" column="grandchild_count" />
- </resultMap>
- <sql id="selectSyVocationalVo">
- select id, code, parent_code, name, level, create_time, ancestors,child_count ,grandchild_count from sy_vocational
- </sql>
- <select id="selectSyVocationalList" parameterType="SyVocational" resultMap="SyVocationalResult">
- <include refid="selectSyVocationalVo"/>
- <where>
- <if test="code != null and code != ''"> and code = #{code}</if>
- <if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="level != null "> and level = #{level}</if>
- <if test="childCount != null "> and child_count = #{childCount}</if>
- <if test="grandchildCount != null "> and grandchild_count = #{grandchildCount}</if>
- <if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
- </where>
- </select>
-
- <select id="selectSyVocationalById" parameterType="Long" resultMap="SyVocationalResult">
- <include refid="selectSyVocationalVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertSyVocational" parameterType="SyVocational" useGeneratedKeys="true" keyProperty="id">
- insert into sy_vocational
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="code != null">code,</if>
- <if test="parentCode != null">parent_code,</if>
- <if test="name != null">name,</if>
- <if test="level != null">level,</if>
- <if test="createTime != null">create_time,</if>
- <if test="ancestors != null">ancestors,</if>
- <if test="childCount != null">child_count,</if>
- <if test="grandchildCount != null">grandchild_count,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="code != null">#{code},</if>
- <if test="parentCode != null">#{parentCode},</if>
- <if test="name != null">#{name},</if>
- <if test="level != null">#{level},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="ancestors != null">#{ancestors},</if>
- <if test="childCount != null">#{childCount},</if>
- <if test="grandchildCount != null">#{grandchildCount},</if>
- </trim>
- </insert>
- <update id="updateSyVocational" parameterType="SyVocational">
- update sy_vocational
- <trim prefix="SET" suffixOverrides=",">
- <if test="code != null">code = #{code},</if>
- <if test="parentCode != null">parent_code = #{parentCode},</if>
- <if test="name != null">name = #{name},</if>
- <if test="level != null">level = #{level},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="ancestors != null">ancestors = #{ancestors},</if>
- <if test="childCount != null">child_count = #{childCount},</if>
- <if test="grandchildCount != null">grandchild_count = #{grandchildCount},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteSyVocationalById" parameterType="Long">
- delete from sy_vocational where id = #{id}
- </delete>
- <delete id="deleteSyVocationalByIds" parameterType="String">
- delete from sy_vocational where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|