123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?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.miniapp.bus.mapper.BkFenceMapper">
-
- <resultMap type="com.miniapp.bus.domain.BkFence" id="BkFenceResult">
- <result property="id" column="id" />
- <result property="customerId" column="customer_id" />
- <result property="productId" column="product_id" />
- <result property="fenceName" column="fence_name" />
- <result property="fenceAlias" column="fence_alias" />
- <result property="fenceStartAddress" column="fence_start_address" />
- <result property="fenceStartLocation" column="fence_start_location" />
- <result property="fenceEndAddress" column="fence_end_address" />
- <result property="fenceEndLocation" column="fence_end_location" />
- <result property="status" column="status" />
- <result property="deltag" column="deltag" />
- <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>
-
- <resultMap type="com.miniapp.bus.domain.dto.BkFenceDto" id="BkFenceDtoResult">
- <result property="id" column="id" />
- <result property="customerId" column="customer_id" />
- <result property="productId" column="product_id" />
- <result property="fenceName" column="fence_name" />
- <result property="fenceAlias" column="fence_alias" />
- <result property="fenceStartAddress" column="fence_start_address" />
- <result property="fenceStartLocation" column="fence_start_location" />
- <result property="fenceEndAddress" column="fence_end_address" />
- <result property="fenceEndLocation" column="fence_end_location" />
- <result property="status" column="status" />
- <result property="deltag" column="deltag" />
- <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" />
- <result property="customerName" column="customer_name" />
- <result property="productName" column="productName" />
- </resultMap>
- <sql id="selectBkFenceVo">
- select id, customer_id, product_id, fence_name, fence_alias, fence_start_address, fence_start_location,fence_end_address,fence_end_location, status, deltag, create_by, create_time, update_by, update_time, remark from bk_fence
- </sql>
- <select id="selectBkFenceList" parameterType="BkFence" resultMap="BkFenceResult">
- <include refid="selectBkFenceVo"/>
- <where>
- <if test="customerId != null "> and customer_id = #{customerId}</if>
- <if test="productId != null "> and product_id = #{productId}</if>
- <if test="fenceName != null and fenceName != ''"> and fence_name like concat('%', #{fenceName}, '%')</if>
- <if test="fenceAlias != null and fenceAlias != ''"> and fence_alias = #{fenceAlias}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
- </where>
- </select>
-
- <select id="selectBkFenceById" parameterType="Long" resultMap="BkFenceResult">
- <include refid="selectBkFenceVo"/>
- where id = #{id}
- </select>
- <insert id="insertBkFence" parameterType="BkFence" useGeneratedKeys="true" keyProperty="id">
- insert into bk_fence
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="customerId != null">customer_id,</if>
- <if test="productId != null">product_id,</if>
- <if test="fenceName != null">fence_name,</if>
- <if test="fenceAlias != null">fence_alias,</if>
- <if test="fenceStartAddress != null">fence_start_address,</if>
- <if test="fenceStartLocation != null">fence_start_location,</if>
- <if test="fenceEndAddress != null">fence_end_address,</if>
- <if test="fenceEndLocation != null">fence_end_location,</if>
- <if test="status != null">status,</if>
- <if test="deltag != null">deltag,</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="customerId != null">#{customerId},</if>
- <if test="productId != null">#{productId},</if>
- <if test="fenceName != null">#{fenceName},</if>
- <if test="fenceAlias != null">#{fenceAlias},</if>
- <if test="fenceStartAddress != null">#{fenceStartAddress},</if>
- <if test="fenceStartLocation != null">#{fenceStartLocation},</if>
- <if test="fenceEndAddress != null">#{fenceEndAddress},</if>
- <if test="fenceEndLocation != null">#{fenceEndLocation},</if>
- <if test="status != null">#{status},</if>
- <if test="deltag != null">#{deltag},</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="updateBkFence" parameterType="BkFence">
- update bk_fence
- <trim prefix="SET" suffixOverrides=",">
- <if test="customerId != null">customer_id = #{customerId},</if>
- <if test="productId != null">product_id = #{productId},</if>
- <if test="fenceName != null">fence_name = #{fenceName},</if>
- <if test="fenceAlias != null">fence_alias = #{fenceAlias},</if>
- <if test="fenceStartAddress != null">fence_start_address = #{fenceStartAddress},</if>
- <if test="fenceStartLocation != null">fence_start_location = #{fenceStartLocation},</if>
- <if test="fenceEndAddress != null">fence_end_address = #{fenceEndAddress},</if>
- <if test="fenceEndLocation != null">fence_end_location = #{fenceEndLocation},</if>
- <if test="status != null">status = #{status},</if>
- <if test="deltag != null">deltag = #{deltag},</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="deleteBkFenceById" parameterType="Long">
- delete from bk_fence where id = #{id}
- </delete>
- <delete id="deleteBkFenceByIds" parameterType="String">
- delete from bk_fence where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-
- <select id="selectBkFenceDtoList" parameterType="com.miniapp.bus.domain.dto.BkFenceDto" resultMap="BkFenceDtoResult">
- select t.id, t.customer_id, t.product_id, t.fence_name, t.fence_alias, t.fence_start_address, t.fence_start_location,t.fence_end_address,t.fence_end_location, t.status, t.deltag, t.create_by, t.create_time, t.update_by, t.update_time, t.remark,a.productName,b.customer_name from bk_fence t
- LEFT JOIN basic_product a ON t.product_id = a.id
- LEFT JOIN basic_customer b ON t.customer_id = b.id
- <where>
- <if test="customerId != null "> and customer_id = #{customerId}</if>
- <if test="productId != null "> and product_id = #{productId}</if>
- <if test="fenceName != null and fenceName != ''"> and fence_name like concat('%', #{fenceName}, '%')</if>
- <if test="fenceAlias != null and fenceAlias != ''"> and fence_alias = #{fenceAlias}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
- </where>
- </select>
- </mapper>
|