| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?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.zd.alg.smartlock.mapper.SlApplyApprovalMapper">
- <resultMap type="com.zd.algorithm.api.smartlock.entity.SlApplyApproval" id="SlApplyApprovalResult">
- <result property="id" column="id"/>
- <result property="applyId" column="apply_id"/>
- <result property="deptId" column="dept_id"/>
- <result property="deptName" column="dept_name"/>
- <result property="approvaId" column="approva_id"/>
- <result property="approvaName" column="approva_name"/>
- <result property="approvaStatus" column="approva_status"/>
- <result property="cretaTime" column="creta_time"/>
- </resultMap>
- <sql id="selectSlApplyApprovalVo">
- select id,
- apply_id,
- dept_id,
- dept_name,
- approva_id,
- approva_name,
- approva_status,
- creta_time
- from sl_apply_approval
- </sql>
- <sql id="selectSlApplyApprovalListVo">
- select t.id,
- t.apply_id,
- t.dept_id,
- t.dept_name,
- t.approva_id,
- t.approva_name,
- t.approva_status,
- t.creta_time
- from sl_apply_approval as t
- </sql>
- <select id="selectSlApplyApprovalList" parameterType="com.zd.algorithm.api.smartlock.entity.SlApplyApproval"
- resultMap="SlApplyApprovalResult">
- <include refid="selectSlApplyApprovalVo"/>
- <where>
- <if test="applyId != null ">and apply_id = #{applyId}</if>
- <if test="approvaId != null ">and approva_id = #{approvaId}</if>
- <if test="approvaName != null and approvaName != ''">and approva_name like concat('%', #{approvaName},
- '%')
- </if>
- <if test="approvaStatus != null ">and approva_status = #{approvaStatus}</if>
- <if test="cretaTime != null ">and creta_time = #{cretaTime}</if>
- </where>
- </select>
- <select id="getListByIds" resultMap="SlApplyApprovalResult">
- <include refid="selectSlApplyApprovalVo"/>
- <where>
- id in
- <foreach item="id" collection="list" open="(" separator="," close=")">
- #{id}
- </foreach>
- </where>
- </select>
- <select id="selectSlApplyApprovalById" resultMap="SlApplyApprovalResult">
- <include refid="selectSlApplyApprovalVo"/>
- where id = #{id}
- </select>
- <insert id="insertSlApplyApproval" parameterType="com.zd.algorithm.api.smartlock.entity.SlApplyApproval"
- useGeneratedKeys="true"
- keyProperty="id">
- insert into sl_apply_approval
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="applyId != null">apply_id,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="deptName != null">dept_name,</if>
- <if test="approvaId != null">approva_id,</if>
- <if test="approvaName != null">approva_name,</if>
- <if test="approvaStatus != null">approva_status,</if>
- <if test="cretaTime != null">creta_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="applyId != null">#{applyId},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="deptName != null">#{deptName},</if>
- <if test="approvaId != null">#{approvaId},</if>
- <if test="approvaName != null">#{approvaName},</if>
- <if test="approvaStatus != null">#{approvaStatus},</if>
- <if test="cretaTime != null">#{cretaTime},</if>
- </trim>
- </insert>
- <update id="updateSlApplyApproval" parameterType="com.zd.algorithm.api.smartlock.entity.SlApplyApproval">
- update sl_apply_approval
- <trim prefix="SET" suffixOverrides=",">
- <if test="applyId != null">apply_id = #{applyId},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="deptName != null">dept_name = #{deptName},</if>
- <if test="approvaId != null">approva_id = #{approvaId},</if>
- <if test="approvaName != null">approva_name = #{approvaName},</if>
- <if test="approvaStatus != null">approva_status = #{approvaStatus},</if>
- <if test="cretaTime != null">creta_time = #{cretaTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteSlApplyApprovalById">
- delete
- from sl_apply_approval
- where id = #{id}
- </delete>
- <delete id="deleteSlApplyApprovalByIds">
- delete from sl_apply_approval where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|