123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?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.supervision.bdglSecret.mapper.BdglSecretMapper">
-
- <resultMap type="BdglSecret" id="BdglSecretResult">
- <result property="id" column="id" />
- <result property="secrecyType" column="secrecy_type" />
- <result property="number" column="number" />
- <result property="name" column="name" />
- <result property="kind" column="kind" />
- <result property="version" column="version" />
- <result property="confidential" column="confidential" />
- <result property="peopleId" column="people_id" />
- <result property="peopleId1" column="people_id1" />
- <result property="peopleId2" column="people_id2" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- <result property="hindOverTime" column="hind_over_time" />
- <result property="unitId" column="unit_id" />
- <result property="peopleName" column="people_name" />
- <result property="people1Name" column="people1_name" />
- <result property="people2Name" column="people2_name" />
- <result property="deptName" column="dept_name" />
- <result property="remarks" column="remarks" />
- </resultMap>
- <sql id="selectBdglSecretVo">
- select id, secrecy_type, number, name, kind, version, confidential, people_id, people_id1, people_id2, start_time, end_time, hind_over_time, unit_id, people_name, people1_name, people2_name, dept_name,remarks from bdgl_secret
- </sql>
- <select id="selectBdglSecretList" parameterType="BdglSecret" resultMap="BdglSecretResult">
- <include refid="selectBdglSecretVo"/>
- <where>
- <if test="secrecyType != null "> and secrecy_type = #{secrecyType}</if>
- <if test="number != null and number != ''"> and number = #{number}</if>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="kind != null and kind != ''"> and kind = #{kind}</if>
- <if test="version != null and version != ''"> and version = #{version}</if>
- <if test="confidential != null and confidential != ''"> and confidential = #{confidential}</if>
- <if test="peopleId != null "> and people_id = #{peopleId}</if>
- <if test="peopleId1 != null "> and people_id1 = #{peopleId1}</if>
- <if test="peopleId2 != null "> and people_id2 = #{peopleId2}</if>
- <if test="startTime != null "> and start_time = #{startTime}</if>
- <if test="endTime != null "> and end_time = #{endTime}</if>
- <if test="hindOverTime != null "> and hind_over_time = #{hindOverTime}</if>
- <if test="unitId != null "> and unit_id = #{unitId}</if>
- <if test="peopleName != null and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>
- <if test="people1Name != null and people1Name != ''"> and people1_name like concat('%', #{people1Name}, '%')</if>
- <if test="people2Name != null and people2Name != ''"> and people2_name like concat('%', #{people2Name}, '%')</if>
- <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
- <if test="remarks != null and remarks != ''"> and remarks like concat('%', #{remarks}, '%')</if>
- </where>
- order by start_time desc
- </select>
-
- <select id="selectBdglSecretById" parameterType="Integer" resultMap="BdglSecretResult">
- <include refid="selectBdglSecretVo"/>
- where id = #{id}
- </select>
- <select id="selectBdglSecretNumber" resultMap="BdglSecretResult">
- SELECT
- count(id) as number,
- kind
- FROM
- bdgl_secret
- GROUP BY kind
- order by kind asc
- </select>
- <insert id="insertBdglSecret" parameterType="BdglSecret" useGeneratedKeys="true" keyProperty="id">
- insert into bdgl_secret
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="secrecyType != null">secrecy_type,</if>
- <if test="number != null">number,</if>
- <if test="name != null">name,</if>
- <if test="kind != null">kind,</if>
- <if test="version != null">version,</if>
- <if test="confidential != null">confidential,</if>
- <if test="peopleId != null">people_id,</if>
- <if test="peopleId1 != null">people_id1,</if>
- <if test="peopleId2 != null">people_id2,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- <if test="hindOverTime != null">hind_over_time,</if>
- <if test="unitId != null">unit_id,</if>
- <if test="peopleName != null">people_name,</if>
- <if test="people1Name != null">people1_name,</if>
- <if test="people2Name != null">people2_name,</if>
- <if test="deptName != null">dept_name,</if>
- <if test="remarks != null">remarks,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="secrecyType != null">#{secrecyType},</if>
- <if test="number != null">#{number},</if>
- <if test="name != null">#{name},</if>
- <if test="kind != null">#{kind},</if>
- <if test="version != null">#{version},</if>
- <if test="confidential != null">#{confidential},</if>
- <if test="peopleId != null">#{peopleId},</if>
- <if test="peopleId1 != null">#{peopleId1},</if>
- <if test="peopleId2 != null">#{peopleId2},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- <if test="hindOverTime != null">#{hindOverTime},</if>
- <if test="unitId != null">#{unitId},</if>
- <if test="peopleName != null">#{peopleName},</if>
- <if test="people1Name != null">#{people1Name},</if>
- <if test="people2Name != null">#{people2Name},</if>
- <if test="deptName != null">#{deptName},</if>
- <if test="remarks != null">#{remarks},</if>
- </trim>
- </insert>
- <update id="updateBdglSecret" parameterType="BdglSecret">
- update bdgl_secret
- <trim prefix="SET" suffixOverrides=",">
- <if test="secrecyType != null">secrecy_type = #{secrecyType},</if>
- <if test="number != null">number = #{number},</if>
- <if test="name != null">name = #{name},</if>
- <if test="kind != null">kind = #{kind},</if>
- <if test="version != null">version = #{version},</if>
- <if test="confidential != null">confidential = #{confidential},</if>
- <if test="peopleId != null">people_id = #{peopleId},</if>
- <if test="peopleId1 != null">people_id1 = #{peopleId1},</if>
- <if test="peopleId2 != null">people_id2 = #{peopleId2},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="endTime != null">end_time = #{endTime},</if>
- <if test="hindOverTime != null">hind_over_time = #{hindOverTime},</if>
- <if test="unitId != null">unit_id = #{unitId},</if>
- <if test="peopleName != null">people_name = #{peopleName},</if>
- <if test="people1Name != null">people1_name = #{people1Name},</if>
- <if test="people2Name != null">people2_name = #{people2Name},</if>
- <if test="deptName != null">dept_name = #{deptName},</if>
- <if test="remarks != null">remarks = #{deptName},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteBdglSecretById" parameterType="Integer">
- delete from bdgl_secret where id = #{id}
- </delete>
- <delete id="deleteBdglSecretByIds" parameterType="String">
- delete from bdgl_secret where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|