| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?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="org.dromara.physical.mapper.PhysicalBlindStructuresMapper">
- <!-- 查询所有(可选分页) -->
- <select id="selectPhysicalBlindStructureAllPage" resultType="org.dromara.physical.domain.vo.PhysicalBlindStructuresVo">
- SELECT
- id,
- name,
- description,
- created_at,
- updated_at,
- create_user_id,
- update_user_id
- FROM physical_blind_structures ${ew.customSqlSegment}
- </select>
- <!-- 查询所有(可选分页) -->
- <select id="selectPhysicalBlindStructureList" resultType="org.dromara.physical.domain.vo.PhysicalBlindStructuresVo">
- SELECT
- id,
- name,
- description,
- created_at,
- updated_at,
- create_user_id,
- update_user_id
- FROM physical_blind_structures ${ew.customSqlSegment}
- </select>
- <!-- 查询所有(可选分页) -->
- <select id="selectPhysicalBlindStructureById" resultType="org.dromara.physical.domain.vo.PhysicalBlindStructuresVo">
- SELECT
- id,
- name,
- description,
- created_at,
- updated_at,
- create_user_id,
- update_user_id
- FROM physical_blind_structures WHERE id = #{id}
- </select>
- <!-- 插入(动态非空字段) -->
- <insert id="insertPhysicalBlindStructure" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO physical_blind_structures (
- <trim suffixOverrides=",">
- <if test="name != null and name != ''">name,</if>
- <if test="description != null and description != ''">description,</if>
- <if test="createUserId != null">create_user_id,</if>
- <if test="updateUserId != null">update_user_id,</if>
- created_at,
- updated_at
- </trim>
- ) VALUES (
- <trim suffixOverrides=",">
- <if test="name != null and name != ''">#{name},</if>
- <if test="description != null and description != ''">#{description},</if>
- <if test="createUserId != null">#{createUserId},</if>
- <if test="updateUserId != null">#{updateUserId},</if>
- NOW(),
- NOW()
- </trim>
- )
- </insert>
- <!-- 更新(动态非空字段) -->
- <update id="updatePhysicalBlindStructure">
- UPDATE physical_blind_structures
- <set>
- <if test="name != null and name != ''">name = #{name},</if>
- <if test="description != null">description = #{description},</if>
- <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
- updated_at = NOW()
- </set>
- WHERE id = #{id}
- </update>
- <delete id="deletePhysicalBlindStructure">
- DELETE FROM physical_blind_structures
- <where>
- id IN
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- <if test="id > 0">
- #{id}
- </if>
- </foreach>
- </where>
- </delete>
- </mapper>
|