123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?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.yijia.integral.mapper.IntegralOrderMapper">
- <resultMap type="IntegralOrder" id="IntegralOrderResult">
- <result property="id" column="id" />
- <result property="integralOrderNo" column="integral_order_no" />
- <result property="waresType" column="wares_type" />
- <result property="waresName" column="wares_name" />
- <result property="waresId" column="wares_id" />
- <result property="unionId" column="union_id" />
- <result property="customerName" column="customer_name" />
- <result property="exchangeNum" column="exchange_num" />
- <result property="exchangeTime" column="exchange_time" />
- <result property="status" column="status" />
- <result property="integral" column="integral" />
- <result property="stationId" column="station_id" />
- <result property="stationName" column="station_name" />
- <result property="mobilePhone" column="mobile_phone" />
- </resultMap>
- <sql id="selectIntegralOrderVo">
- select id, integral_order_no, wares_type, wares_name, wares_id, union_id, customer_name, exchange_num, exchange_time,
- p.status, integral, station_id,d.dept_name as station_name,mobile_phone
- from integral_order p join sys_dept d on p.station_id =d.dept_id
- </sql>
- <select id="selectIntegralOrderList" parameterType="IntegralOrder" resultMap="IntegralOrderResult">
- <include refid="selectIntegralOrderVo"/>
- <where>
- <if test="integralOrderNo != null and integralOrderNo != ''"> and integral_order_no like concat('%', #{integralOrderNo}, '%')</if>
- <if test="waresType != null and waresType != ''"> and wares_type = #{waresType}</if>
- <if test="waresName != null and waresName != ''"> and wares_name like concat('%', #{waresName}, '%')</if>
- <if test="waresId != null "> and wares_id = #{waresId}</if>
- <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="exchangeNum != null "> and exchange_num = #{exchangeNum}</if>
- <if test="exchangeTime != null "> and exchange_time = #{exchangeTime}</if>
- <if test="status != null and status != ''"> and p.status = #{status}</if>
- <if test="integral != null "> and integral = #{integral}</if>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="mobilePhone != null "> and mobile_phone = #{mobilePhone}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by id desc
- </select>
- <select id="selectIntegralOrderById" parameterType="Long" resultMap="IntegralOrderResult">
- <include refid="selectIntegralOrderVo"/>
- where id = #{id}
- </select>
- <insert id="insertIntegralOrder" parameterType="IntegralOrder" useGeneratedKeys="true" keyProperty="id">
- insert into integral_order
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="integralOrderNo != null">integral_order_no,</if>
- <if test="waresType != null">wares_type,</if>
- <if test="waresName != null">wares_name,</if>
- <if test="waresId != null">wares_id,</if>
- <if test="unionId != null">union_id,</if>
- <if test="customerName != null">customer_name,</if>
- <if test="exchangeNum != null">exchange_num,</if>
- <if test="exchangeTime != null">exchange_time,</if>
- <if test="status != null">status,</if>
- <if test="integral != null">integral,</if>
- <if test="stationId != null">station_id,</if>
- <if test="mobilePhone != null "> mobile_phone,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="integralOrderNo != null">#{integralOrderNo},</if>
- <if test="waresType != null">#{waresType},</if>
- <if test="waresName != null">#{waresName},</if>
- <if test="waresId != null">#{waresId},</if>
- <if test="unionId != null">#{unionId},</if>
- <if test="customerName != null">#{customerName},</if>
- <if test="exchangeNum != null">#{exchangeNum},</if>
- <if test="exchangeTime != null">#{exchangeTime},</if>
- <if test="status != null">#{status},</if>
- <if test="integral != null">#{integral},</if>
- <if test="stationId != null">#{stationId},</if>
- <if test="mobilePhone != null">#{mobilePhone},</if>
- </trim>
- </insert>
- <update id="updateIntegralOrder" parameterType="IntegralOrder">
- update integral_order
- <trim prefix="SET" suffixOverrides=",">
- <if test="integralOrderNo != null">integral_order_no = #{integralOrderNo},</if>
- <if test="waresType != null">wares_type = #{waresType},</if>
- <if test="waresName != null">wares_name = #{waresName},</if>
- <if test="waresId != null">wares_id = #{waresId},</if>
- <if test="unionId != null">union_id = #{unionId},</if>
- <if test="customerName != null">customer_name = #{customerName},</if>
- <if test="exchangeNum != null">exchange_num = #{exchangeNum},</if>
- <if test="exchangeTime != null">exchange_time = #{exchangeTime},</if>
- <if test="status != null">status = #{status},</if>
- <if test="integral != null">integral = #{integral},</if>
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="mobilePhone != null "> mobile_phone = #{mobilePhone},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteIntegralOrderById" parameterType="Long">
- delete from integral_order where id = #{id}
- </delete>
- <delete id="deleteIntegralOrderByIds" parameterType="String">
- delete from integral_order where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|