123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?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.grassrootsregistration.mapper.BdglPartyMapper">
- <resultMap type="BdglParty" id="BdglPartyResult">
- <result property="id" column="id" />
- <result property="convokeTime" column="convoke_time" />
- <result property="address" column="address" />
- <result property="compereId" column="compere_id" />
- <result property="joinId" column="join_id" />
- <result property="peopleIds" column="people_ids" />
- <result property="absentIds" column="absent_ids" />
- <result property="peopleId" column="people_id" />
- <result property="title" column="title" />
- <result property="contents" column="contents" />
- <result property="createtime" column="createtime" />
- <result property="updatetime" column="updatetime" />
- <result property="unitId" column="unit_id" />
- <result property="unitName" column="unit_name" />
- <result property="compereRen" column="compere_ren" />
- <result property="peopleJiLu" column="people_ji_lu" />
- <result property="fileUrl" column="file_url" />
- <result property="meetingForm" column="meeting_form" />
- </resultMap>
- <sql id="selectBdglPartyVo">
- select id, convoke_time, address, compere_id, join_id, people_ids, absent_ids, people_id, title, contents, createtime, updatetime, unit_id ,unit_name ,compere_ren,people_ji_lu,file_url,meeting_form from bdgl_party
- </sql>
- <select id="selectBdglPartyList" parameterType="BdglParty" resultMap="BdglPartyResult">
- select id, convoke_time, address, compere_id, join_id, people_ids, absent_ids, people_id, title, contents, createtime, updatetime, unit_id ,unit_name ,compere_ren,people_ji_lu,file_url,meeting_form
- from bdgl_party p left join sys_dept t
- on p.unit_id=t.dept_id
- <where>
- <if test="unitId !=null">
- and (p.unit_id=#{unitId} or find_in_set(#{unitId}, t.ancestors))
- </if>
- <if test="convokeTime != null "> and p.convoke_time = #{convokeTime}</if>
- <if test="address != null and address != ''"> and p.address = #{address}</if>
- <if test="compereId != null "> and p.compere_id = #{compereId}</if>
- <if test="joinId != null and joinId != ''"> and p.join_id = #{joinId}</if>
- <if test="peopleIds != null and peopleIds != ''"> and p.people_ids = #{peopleIds}</if>
- <if test="absentIds != null and absentIds != ''"> and p.absent_ids = #{absentIds}</if>
- <if test="peopleId != null "> and p.people_id = #{peopleId}</if>
- <if test="title != null and title != ''"> and p.title = #{title}</if>
- <if test="contents != null and contents != ''"> and p.contents = #{contents}</if>
- <if test="createtime != null and createtime != ''"> and p.createtime = #{createtime}</if>
- <if test="updatetime != null and updatetime != ''"> and p.updatetime = #{updatetime}</if>
- <if test="compereRen != null "> and p.compere_ren = #{compereRen}</if>
- <if test="peopleJiLu != null "> and p.people_ji_lu = #{peopleJiLu}</if>
- <if test="fileUrl != null "> and p.file_url = #{fileUrl}</if>
- <if test="meetingForm != null "> and p.meeting_form = #{meetingForm}</if>
- <if test="unitName != null "> and unit_name LIKE concat('%', #{unitName}, '%')</if>
- </where>
- order by p.id desc
- </select>
- <select id="selectPartyOnUnitList" parameterType="BdglParty" resultMap="BdglPartyResult">
- select id, convoke_time, address, compere_id, join_id, people_ids, absent_ids, people_id, title, contents, createtime, updatetime, unit_id ,unit_name ,compere_ren,people_ji_lu,file_url,meeting_form
- from bdgl_party
- <where>
- <if test="unitId != null"> and unit_id = #{unitId}</if>
- <if test="year != null and year != ''"> and YEAR(convoke_time)= #{year}</if>
- </where>
- order by id desc
- </select>
- <select id="selectBdglPartyById" parameterType="Integer" resultMap="BdglPartyResult">
- <include refid="selectBdglPartyVo"/>
- where id = #{id}
- </select>
- <select id="selectlPartyByunitId" resultType="java.lang.Integer">
- select count(*) from bdgl_party where unit_id = #{unitId} and YEAR(convoke_time)= #{year}
- </select>
- <insert id="insertBdglParty" parameterType="BdglParty" useGeneratedKeys="true" keyProperty="id">
- insert into bdgl_party
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="convokeTime != null">convoke_time,</if>
- <if test="address != null">address,</if>
- <if test="compereId != null">compere_id,</if>
- <if test="joinId != null">join_id,</if>
- <if test="peopleIds != null">people_ids,</if>
- <if test="absentIds != null">absent_ids,</if>
- <if test="peopleId != null">people_id,</if>
- <if test="title != null">title,</if>
- <if test="contents != null">contents,</if>
- <if test="createtime != null">createtime,</if>
- <if test="updatetime != null">updatetime,</if>
- <if test="unitId != null">unit_id,</if>
- <if test="unitName != null">unit_name,</if>
- <if test="compereRen != null">compere_ren,</if>
- <if test="peopleJiLu != null">people_ji_lu,</if>
- <if test="fileUrl != null">file_url,</if>
- <if test="meetingForm != null">meeting_form,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="convokeTime != null">#{convokeTime},</if>
- <if test="address != null">#{address},</if>
- <if test="compereId != null">#{compereId},</if>
- <if test="joinId != null">#{joinId},</if>
- <if test="peopleIds != null">#{peopleIds},</if>
- <if test="absentIds != null">#{absentIds},</if>
- <if test="peopleId != null">#{peopleId},</if>
- <if test="title != null">#{title},</if>
- <if test="contents != null">#{contents},</if>
- <if test="createtime != null">#{createtime},</if>
- <if test="updatetime != null">#{updatetime},</if>
- <if test="unitId != null">#{unitId},</if>
- <if test="unitName != null">#{unitName},</if>
- <if test="compereRen != null">#{compereRen},</if>
- <if test="peopleJiLu != null">#{peopleJiLu},</if>
- <if test="fileUrl != null">#{fileUrl},</if>
- <if test="meetingForm != null">#{meetingForm},</if>
- </trim>
- </insert>
- <update id="updateBdglParty" parameterType="BdglParty">
- update bdgl_party
- <trim prefix="SET" suffixOverrides=",">
- <if test="convokeTime != null">convoke_time = #{convokeTime},</if>
- <if test="address != null">address = #{address},</if>
- <if test="compereId != null">compere_id = #{compereId},</if>
- <if test="joinId != null">join_id = #{joinId},</if>
- <if test="peopleIds != null">people_ids = #{peopleIds},</if>
- <if test="absentIds != null">absent_ids = #{absentIds},</if>
- <if test="peopleId != null">people_id = #{peopleId},</if>
- <if test="title != null">title = #{title},</if>
- <if test="contents != null">contents = #{contents},</if>
- <if test="createtime != null">createtime = #{createtime},</if>
- <if test="updatetime != null">updatetime = #{updatetime},</if>
- <if test="unitId != null">unit_id = #{unitId},</if>
- <if test="compereRen != null">compere_ren = #{compereRen},</if>
- <if test="peopleJiLu != null">people_ji_lu = #{peopleJiLu},</if>
- <if test="fileUrl != null">file_url = #{fileUrl},</if>
- <if test="meetingForm != null">meeting_form = #{meetingForm},</if>
- <if test="unitName != null">unit_name = #{unitName},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteBdglPartyById" parameterType="Integer">
- delete from bdgl_party where id = #{id}
- </delete>
- <delete id="deleteBdglPartyByIds" parameterType="String">
- delete from bdgl_party where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|