2023-11-28 20:33:38 +08:00
|
|
|
<?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.bonus.sgzb.base.mapper.BmUnitPersonMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.bonus.sgzb.base.domain.BmUnitPerson" id="BmUnitPersonResult">
|
|
|
|
|
<id property="unitId" column="unit_id" />
|
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
|
<result property="companyId" column="company_id" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="bmUnitPerson">
|
|
|
|
|
select unit_id, user_id, company_id
|
|
|
|
|
from bm_unit_person
|
|
|
|
|
</sql>
|
2023-12-23 22:52:36 +08:00
|
|
|
|
2023-11-28 20:33:38 +08:00
|
|
|
|
|
|
|
|
<select id="getUnitPersonAll" resultMap="BmUnitPersonResult">
|
2023-11-30 20:15:53 +08:00
|
|
|
<!--<include refid="bmUnitInfo"/>-->
|
|
|
|
|
select unit_id, user_id, company_id
|
|
|
|
|
from bm_unit_person
|
2023-11-28 20:33:38 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getUnitPerson" parameterType="com.bonus.sgzb.base.domain.BmUnitPerson" resultMap="BmUnitPersonResult">
|
|
|
|
|
<include refid="bmUnitPerson"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="unitId != null and unitId != ''">
|
|
|
|
|
AND unit_id = #{unitId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userId != null and userId != ''">
|
|
|
|
|
AND user_id = #{userId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyId != null and companyId != ''">
|
|
|
|
|
AND company_id = #{companyId}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
2023-12-23 22:52:36 +08:00
|
|
|
<select id="getUnitPersons" parameterType="Long" resultMap="BmUnitPersonResult">
|
|
|
|
|
<include refid="bmUnitPerson"/>
|
|
|
|
|
where unit_id = #{unitId}
|
|
|
|
|
</select>
|
2023-11-28 20:33:38 +08:00
|
|
|
|
|
|
|
|
<insert id="unitPersonAdd" parameterType="com.bonus.sgzb.base.domain.BmUnitPerson">
|
|
|
|
|
insert into bm_unit_person (
|
2023-12-19 00:31:13 +08:00
|
|
|
<if test="unitId != null and unitId != '' ">unit_id,</if>
|
|
|
|
|
<if test="userId != null and userId != '' ">user_id</if>
|
2023-11-28 20:33:38 +08:00
|
|
|
)values(
|
2023-12-19 00:31:13 +08:00
|
|
|
<if test="unitId != null and unitId != ''">#{unitId},</if>
|
|
|
|
|
<if test="userId != null and userId != ''">#{userId}</if>
|
2023-11-28 20:33:38 +08:00
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateBmUnitPerson" parameterType="com.bonus.sgzb.base.domain.BmUnitPerson">
|
|
|
|
|
update bm_unit_person
|
|
|
|
|
<set>
|
|
|
|
|
<if test="userId != null and userId != ''">user_id = #{userId}</if>
|
|
|
|
|
<if test="companyId != null and companyId != ''">,company_id = #{companyId}</if>
|
|
|
|
|
</set>
|
|
|
|
|
where unit_id = #{unitId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteUnitInfoById" parameterType="Long">
|
|
|
|
|
delete from bm_unit_person where unit_id = #{unitId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="remove" parameterType="Long">
|
|
|
|
|
delete from bm_unit_person where unit_id in
|
|
|
|
|
<foreach item="unitId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{unitId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
</mapper>
|