You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.9 KiB

<?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.ruoyi.system.mapper.BShanghuMapper">
<resultMap type="BShanghu" id="BShanghuResult">
<result property="id" column="id" />
<result property="posName" column="pos_name" />
<result property="phoneNumber" column="phone_number" />
<result property="linkMan" column="link_man" />
<result property="city" column="city" />
<result property="address" column="address" />
<result property="posterId" column="poster_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBShanghuVo">
select id, pos_name, phone_number, link_man, city, address, poster_id, create_by, create_time, update_by, update_time, remark from b_shanghu
</sql>
<select id="selectBShanghuList" parameterType="BShanghu" resultMap="BShanghuResult">
<include refid="selectBShanghuVo"/>
<where>
<if test="posName != null and posName != ''"> and pos_name like concat('%', #{posName}, '%')</if>
<if test="linkMan != null and linkMan != ''"> and link_man like concat('%', #{linkMan}, '%')</if>
<if test="city != null and city != ''"> and city like concat('%', #{city}, '%')</if>
</where>
</select>
<select id="selectBShanghuById" parameterType="Long" resultMap="BShanghuResult">
<include refid="selectBShanghuVo"/>
where id = #{id}
</select>
<insert id="insertBShanghu" parameterType="BShanghu" useGeneratedKeys="true" keyProperty="id">
insert into b_shanghu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="posName != null and posName != ''">pos_name,</if>
<if test="phoneNumber != null and phoneNumber != ''">phone_number,</if>
<if test="linkMan != null and linkMan != ''">link_man,</if>
<if test="city != null and city != ''">city,</if>
<if test="address != null and address != ''">address,</if>
<if test="posterId != null">poster_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="posName != null and posName != ''">#{posName},</if>
<if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
<if test="linkMan != null and linkMan != ''">#{linkMan},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="posterId != null">#{posterId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateBShanghu" parameterType="BShanghu">
update b_shanghu
<trim prefix="SET" suffixOverrides=",">
<if test="posName != null and posName != ''">pos_name = #{posName},</if>
<if test="phoneNumber != null and phoneNumber != ''">phone_number = #{phoneNumber},</if>
<if test="linkMan != null and linkMan != ''">link_man = #{linkMan},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="posterId != null">poster_id = #{posterId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBShanghuById" parameterType="Long">
delete from b_shanghu where id = #{id}
</delete>
<delete id="deleteBShanghuByIds" parameterType="String">
delete from b_shanghu where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>