Bonus-Cloud-Material/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhTeamLeaseInfoMapper.xml

97 lines
4.9 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.warehouse.mapper.WhTeamLeaseInfoMapper">
<resultMap type="com.bonus.material.warehouse.domain.WhTeamLeaseInfo" id="WhTeamLeaseInfoResult">
<result property="id" column="id" />
<result property="agreementId" column="agreement_id" />
<result property="typeId" column="type_id" />
<result property="teamName" column="team_name" />
<result property="leaseMan" column="lease_man" />
<result property="phone" column="phone" />
<result property="num" column="num" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="type" column="type" />
</resultMap>
<sql id="selectWhTeamLeaseInfoVo">
select id, agreement_id, type_id, team_name, lease_man, phone, num, create_by, create_time, update_time, type from wh_team_lease_info
</sql>
<select id="selectWhTeamLeaseInfoList" parameterType="com.bonus.material.warehouse.domain.WhTeamLeaseInfo" resultMap="WhTeamLeaseInfoResult">
<include refid="selectWhTeamLeaseInfoVo"/>
<where>
<if test="agreementId != null "> and agreement_id = #{agreementId}</if>
<if test="typeId != null "> and type_id = #{typeId}</if>
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
<if test="leaseMan != null and leaseMan != ''"> and lease_man = #{leaseMan}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="num != null "> and num = #{num}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
</where>
</select>
<select id="selectWhTeamLeaseInfoById" parameterType="Long" resultMap="WhTeamLeaseInfoResult">
<include refid="selectWhTeamLeaseInfoVo"/>
where id = #{id}
</select>
<insert id="insertWhTeamLeaseInfo" parameterType="com.bonus.material.warehouse.domain.WhTeamLeaseInfo" useGeneratedKeys="true" keyProperty="id">
insert into wh_team_lease_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="agreementId != null">agreement_id,</if>
<if test="typeId != null">type_id,</if>
<if test="teamName != null">team_name,</if>
<if test="leaseMan != null">lease_man,</if>
<if test="phone != null">phone,</if>
<if test="num != null">num,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="agreementId != null">#{agreementId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="teamName != null">#{teamName},</if>
<if test="leaseMan != null">#{leaseMan},</if>
<if test="phone != null">#{phone},</if>
<if test="num != null">#{num},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updateWhTeamLeaseInfo" parameterType="com.bonus.material.warehouse.domain.WhTeamLeaseInfo">
update wh_team_lease_info
<trim prefix="SET" suffixOverrides=",">
<if test="agreementId != null">agreement_id = #{agreementId},</if>
<if test="typeId != null">type_id = #{typeId},</if>
<if test="teamName != null">team_name = #{teamName},</if>
<if test="leaseMan != null">lease_man = #{leaseMan},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="num != null">num = #{num},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWhTeamLeaseInfoById" parameterType="Long">
delete from wh_team_lease_info where id = #{id}
</delete>
<delete id="deleteWhTeamLeaseInfoByIds" parameterType="String">
delete from wh_team_lease_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>