123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <?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.macro.mall.mapper.OmsCompanyAddressMapper">
- <resultMap id="BaseResultMap" type="com.macro.mall.model.OmsCompanyAddress">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="address_name" jdbcType="VARCHAR" property="addressName" />
- <result column="send_status" jdbcType="INTEGER" property="sendStatus" />
- <result column="receive_status" jdbcType="INTEGER" property="receiveStatus" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="province" jdbcType="VARCHAR" property="province" />
- <result column="city" jdbcType="VARCHAR" property="city" />
- <result column="region" jdbcType="VARCHAR" property="region" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- id, address_name, send_status, receive_status, name, phone, province, city, region
- </sql>
- <select id="selectByExample" parameterType="com.macro.mall.model.OmsCompanyAddressExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from oms_company_address
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from oms_company_address
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from oms_company_address
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <delete id="deleteByExample" parameterType="com.macro.mall.model.OmsCompanyAddressExample">
- delete from oms_company_address
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.macro.mall.model.OmsCompanyAddress">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into oms_company_address (address_name, send_status, receive_status,
- name, phone, province,
- city, region)
- values (#{addressName,jdbcType=VARCHAR}, #{sendStatus,jdbcType=INTEGER}, #{receiveStatus,jdbcType=INTEGER},
- #{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR},
- #{city,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.macro.mall.model.OmsCompanyAddress">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into oms_company_address
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="addressName != null">
- address_name,
- </if>
- <if test="sendStatus != null">
- send_status,
- </if>
- <if test="receiveStatus != null">
- receive_status,
- </if>
- <if test="name != null">
- name,
- </if>
- <if test="phone != null">
- phone,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="city != null">
- city,
- </if>
- <if test="region != null">
- region,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="addressName != null">
- #{addressName,jdbcType=VARCHAR},
- </if>
- <if test="sendStatus != null">
- #{sendStatus,jdbcType=INTEGER},
- </if>
- <if test="receiveStatus != null">
- #{receiveStatus,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="region != null">
- #{region,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.macro.mall.model.OmsCompanyAddressExample" resultType="java.lang.Integer">
- select count(*) from oms_company_address
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update oms_company_address
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=BIGINT},
- </if>
- <if test="record.addressName != null">
- address_name = #{record.addressName,jdbcType=VARCHAR},
- </if>
- <if test="record.sendStatus != null">
- send_status = #{record.sendStatus,jdbcType=INTEGER},
- </if>
- <if test="record.receiveStatus != null">
- receive_status = #{record.receiveStatus,jdbcType=INTEGER},
- </if>
- <if test="record.name != null">
- name = #{record.name,jdbcType=VARCHAR},
- </if>
- <if test="record.phone != null">
- phone = #{record.phone,jdbcType=VARCHAR},
- </if>
- <if test="record.province != null">
- province = #{record.province,jdbcType=VARCHAR},
- </if>
- <if test="record.city != null">
- city = #{record.city,jdbcType=VARCHAR},
- </if>
- <if test="record.region != null">
- region = #{record.region,jdbcType=VARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update oms_company_address
- set id = #{record.id,jdbcType=BIGINT},
- address_name = #{record.addressName,jdbcType=VARCHAR},
- send_status = #{record.sendStatus,jdbcType=INTEGER},
- receive_status = #{record.receiveStatus,jdbcType=INTEGER},
- name = #{record.name,jdbcType=VARCHAR},
- phone = #{record.phone,jdbcType=VARCHAR},
- province = #{record.province,jdbcType=VARCHAR},
- city = #{record.city,jdbcType=VARCHAR},
- region = #{record.region,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.OmsCompanyAddress">
- update oms_company_address
- <set>
- <if test="addressName != null">
- address_name = #{addressName,jdbcType=VARCHAR},
- </if>
- <if test="sendStatus != null">
- send_status = #{sendStatus,jdbcType=INTEGER},
- </if>
- <if test="receiveStatus != null">
- receive_status = #{receiveStatus,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="region != null">
- region = #{region,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.macro.mall.model.OmsCompanyAddress">
- update oms_company_address
- set address_name = #{addressName,jdbcType=VARCHAR},
- send_status = #{sendStatus,jdbcType=INTEGER},
- receive_status = #{receiveStatus,jdbcType=INTEGER},
- name = #{name,jdbcType=VARCHAR},
- phone = #{phone,jdbcType=VARCHAR},
- province = #{province,jdbcType=VARCHAR},
- city = #{city,jdbcType=VARCHAR},
- region = #{region,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- </mapper>
|