路线管理列表
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
<?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.mhd.wms.domain.lineManagement.repository.mapper.LineManagementMapper">
|
||||
|
||||
<resultMap type="com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO" id="LineManagementResult">
|
||||
<!-- 租赁相关字段 -->
|
||||
<result property="id" column="id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="routeCode" column="route_code" />
|
||||
<result property="routeName" column="route_name" />
|
||||
<result property="customerJson" column="customer_json" />
|
||||
<!-- 继承自BaseVOEntity的字段 -->
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectLineManagementPo">
|
||||
select
|
||||
a.id,
|
||||
a.organization_id,
|
||||
a.organization_name,
|
||||
a.top_organization_id,
|
||||
a.warehouse_id,
|
||||
COALESCE(w.warehouse_name, a.warehouse_name) as warehouse_name,
|
||||
a.route_code,
|
||||
a.route_name,
|
||||
a.customer_json,
|
||||
a.create_time,
|
||||
a.create_by,
|
||||
a.create_by_name,
|
||||
a.update_time,
|
||||
a.update_by,
|
||||
a.update_by_name,
|
||||
a.del_flag,
|
||||
a.service_items_code,
|
||||
a.second_subject_code,
|
||||
a.second_subject_name,
|
||||
a.service_items_name,
|
||||
a.bill_days,
|
||||
a.bill_time,
|
||||
a.salesman_name,
|
||||
a.settlement_currency,
|
||||
a.salesman_id
|
||||
from lease a
|
||||
LEFT JOIN warehouse w ON a.warehouse_id = w.warehouse_id AND w.del_flag = 1
|
||||
</sql>
|
||||
|
||||
<sql id="selectLineManagementPo1">
|
||||
<where>
|
||||
<!-- ID查询 -->
|
||||
<if test="id != null">
|
||||
and a.id = #{id}
|
||||
</if>
|
||||
<!-- 组织相关查询 -->
|
||||
<if test="organizationId != null">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and a.organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<!-- 仓库相关查询 -->
|
||||
<if test="warehouseId != null">
|
||||
and a.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and (w.warehouse_name like concat('%', #{warehouseName}, '%') or a.warehouse_name like concat('%', #{warehouseName}, '%'))
|
||||
</if>
|
||||
<!-- 线路管理字段查询 -->
|
||||
<if test="routeCode != null and routeCode != ''">
|
||||
and a.route_code like concat('%', #{routeCode}, '%')
|
||||
</if>
|
||||
<if test="routeName != null and routeName != ''">
|
||||
and a.route_name like concat('%', #{routeName}, '%')
|
||||
</if>
|
||||
<if test="customerJson != null and customerJson != ''">
|
||||
and a.customer_json like concat('%', #{customerJson}, '%')
|
||||
</if>
|
||||
<!-- 创建和更新相关条件 -->
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and a.update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<!-- 时间范围查询 -->
|
||||
<if test="createTimeStart != null and createTimeStart != ''">
|
||||
and a.create_time >= #{createTimeStart}
|
||||
</if>
|
||||
<if test="createTimeEnd != null and createTimeEnd != ''">
|
||||
and a.create_time <= #{createTimeEnd}
|
||||
</if>
|
||||
<if test="updateTimeStart != null and updateTimeStart != ''">
|
||||
and a.update_time >= #{updateTimeStart}
|
||||
</if>
|
||||
<if test="updateTimeEnd != null and updateTimeEnd != ''">
|
||||
and a.update_time <= #{updateTimeEnd}
|
||||
</if>
|
||||
<!-- 删除标记 -->
|
||||
<choose>
|
||||
<when test="delFlag != null">
|
||||
and a.del_flag = #{delFlag}
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.del_flag = 1
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 查询列表 -->
|
||||
<select id="queryList" parameterType="com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO" resultMap="LineManagementResult">
|
||||
<include refid="selectLineManagementPo"/>
|
||||
<include refid="selectLineManagementPo1"/>
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user