<?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.gkhy.hazmat.system.mapper.HzWarehouseMapper">
|
<resultMap type="com.gkhy.hazmat.system.domain.HzWarehouse" id="HzWarehouseResult">
|
<result property="id" column="id" />
|
<result property="name" column="name" />
|
<result property="address" column="address" />
|
<result property="companyId" column="company_id" />
|
<result property="delFlag" column="del_flag" />
|
<result property="version" column="version" />
|
<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="companyName" column="company_name"/>
|
</resultMap>
|
|
<sql id="selectWarehouseVo">
|
select a.id, a.name, a.address, a.version, a.company_id,a.del_flag,a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
b.name as company_name
|
from hz_warehouse a
|
left join sys_company b on b.id=a.company_id
|
</sql>
|
<update id="deleteWarehouseById" parameterType="java.lang.Long">
|
update hz_warehouse set del_flag=1 where id=#{warehouseId}
|
</update>
|
|
<select id="checkNameUnique" resultType="com.gkhy.hazmat.system.domain.HzWarehouse">
|
select id,name from hz_warehouse where name=#{name} and company_id=#{companyId} and del_flag=0 limit 1
|
</select>
|
|
<select id="selectWarehouseList" resultMap="HzWarehouseResult"
|
parameterType="com.gkhy.hazmat.system.domain.HzWarehouse">
|
<include refid="selectWarehouseVo"/>
|
<where>
|
and a.del_flag=0
|
<if test="name != null and name != ''">
|
AND a.name like concat('%', #{name}, '%')
|
</if>
|
<if test="companyId != null">
|
AND a.company_id= #{companyId}
|
</if>
|
</where>
|
order by a.id desc
|
</select>
|
|
<select id="selectWarehouseListByIds" resultType="com.gkhy.hazmat.system.domain.HzWarehouse">
|
select id,name from hz_warehouse where del_flag=0 and id in
|
<foreach collection="warehouseIds" item="warehouse" open="(" separator="," close=")">
|
#{warehouse}
|
</foreach>
|
</select>
|
</mapper>
|