72 lines
3.2 KiB
XML
72 lines
3.2 KiB
XML
|
|
<?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.material.basic.mapper.BmUnitPersonMapper">
|
||
|
|
<resultMap type="com.bonus.material.basic.domain.BmUnitPerson" id="BmUnitPersonResult">
|
||
|
|
<result property="ID" column="ID" />
|
||
|
|
<result property="unitId" column="unit_id" />
|
||
|
|
<result property="userId" column="user_id" />
|
||
|
|
<result property="companyId" column="company_id" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectBmUnitPersonVo">
|
||
|
|
select ID, unit_id, user_id, company_id, create_time, update_time from bm_unit_person
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectBmUnitPersonList" parameterType="com.bonus.material.basic.domain.BmUnitPerson" resultMap="BmUnitPersonResult">
|
||
|
|
<include refid="selectBmUnitPersonVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||
|
|
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectBmUnitPersonByID" parameterType="Long" resultMap="BmUnitPersonResult">
|
||
|
|
<include refid="selectBmUnitPersonVo"/>
|
||
|
|
where ID = #{ID}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertBmUnitPerson" parameterType="com.bonus.material.basic.domain.BmUnitPerson" useGeneratedKeys="true" keyProperty="ID">
|
||
|
|
insert into bm_unit_person
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="unitId != null">unit_id,</if>
|
||
|
|
<if test="userId != null">user_id,</if>
|
||
|
|
<if test="companyId != null">company_id,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="unitId != null">#{unitId},</if>
|
||
|
|
<if test="userId != null">#{userId},</if>
|
||
|
|
<if test="companyId != null">#{companyId},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateBmUnitPerson" parameterType="com.bonus.material.basic.domain.BmUnitPerson">
|
||
|
|
update bm_unit_person
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="unitId != null">unit_id = #{unitId},</if>
|
||
|
|
<if test="userId != null">user_id = #{userId},</if>
|
||
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
where ID = #{ID}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteBmUnitPersonByID" parameterType="Long">
|
||
|
|
delete from bm_unit_person where ID = #{ID}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteBmUnitPersonByIDs" parameterType="String">
|
||
|
|
delete from bm_unit_person where ID in
|
||
|
|
<foreach item="ID" collection="array" open="(" separator="," close=")">
|
||
|
|
#{ID}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|