2024-06-02 01:10:24 +00:00
<?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.xdadan.erp.emis.mapper.EmisBaseMapper" >
2024-06-02 07:55:40 +00:00
<resultMap type= "BaseEntity" id= "EmisBaseResult" >
2024-06-02 01:10:24 +00:00
<result property= "remark" column= "remark" />
<result property= "tenantId" column= "tenant_id" />
<result property= "delFlag" column= "del_flag" />
<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= "createSite" column= "create_site" />
<result property= "updateSite" column= "update_site" />
2024-06-02 07:13:27 +00:00
<association property= "createByName" column= "create_by" select= "selectEmpNameByUserId" fetchType= "lazy" />
<association property= "updateByName" column= "update_by" select= "selectEmpNameByUserId" fetchType= "lazy" />
<association property= "createSiteName" column= "create_site" select= "selectSiteNameByCode" fetchType= "lazy" />
<association property= "updateSiteName" column= "update_site" select= "selectSiteNameByCode" fetchType= "lazy" />
2024-06-02 01:10:24 +00:00
</resultMap>
<!-- 查询国家名称 -->
<select id= "selectCountryNameByCode" parameterType= "String" resultType= "string" >
select a.name from emis_country a where a.code = #{code} limit 1
</select>
<!-- 查询国家名称(多个) -->
<select id= "selectGroupCountryNameByCode" parameterType= "String" resultType= "string" >
select GROUP_CONCAT(name) from emis_country where FIND_IN_SET(`code`,#{code})
</select>
<!-- 查询区域名称 -->
<select id= "selectRegionNameByCode" parameterType= "String" resultType= "string" >
select a.region_name from emis_region a where a.region_code = #{code} limit 1
</select>
<!-- 查询站点名称 -->
<select id= "selectSiteNameByCode" parameterType= "String" resultType= "string" >
select a.site_name from emis_site a where a.site_code = #{code} limit 1
</select>
<!-- 查询多个站点名称 -->
<select id= "selectGroupSiteNameByCode" parameterType= "String" resultType= "string" >
select group_concat(a.site_name) as site_name from emis_site a where a.del_flag='0' and FIND_IN_SET(a.site_code, #{code}) limit 1
</select>
<!-- 查询国家区域名称 -->
<select id= "selectCountryAreaNameById" parameterType= "long" resultType= "string" >
select a.name from emis_country_area a where a.id = #{id} limit 1
</select>
<!-- 查询线路名称 -->
<select id= "selectLineNameByCode" parameterType= "String" resultType= "string" >
select a.line_name from emis_trans_line a where a.line_code = #{code} limit 1
</select>
<!-- 查询多个产品名称 -->
<select id= "selectProdNameByCode" parameterType= "String" resultType= "string" >
select group_concat(a.prod_name) from emis_trans_product a where FIND_IN_SET(a.prod_code, #{code}) limit 1
</select>
<!-- 根据产品查线路名称 -->
<select id= "selectLineNameByProdCode" parameterType= "String" resultType= "string" >
select a.line_name from emis_trans_line a,emis_trans_product b where a.line_code=b.trans_line_code and b.prod_code = #{code} limit 1
</select>
<!-- 根据产品查线路编号 -->
<select id= "selectLineProdByProdCode" parameterType= "string" resultType= "string" >
select trans_line_code from emis_trans_product a where del_flag='0' and prod_code=#{code} limit 1
</select>
2024-06-08 07:07:48 +00:00
<!-- 根据线路获取出发国家名称 -->
<select id= "selectFromCountryNameByLineCode" parameterType= "String" resultType= "string" >
select a.name from emis_country a,emis_trans_line b where a.del_flag='0' and b.del_flag='0' and a.code=b.from_country and b.line_code = #{code} limit 1
</select>
<!-- 根据线路获取目的国家名称 -->
<select id= "selectDestCountryNameByLineCode" parameterType= "String" resultType= "string" >
select a.name from emis_country a,emis_trans_line b where a.del_flag='0' and b.del_flag='0' and a.code=b.country and b.line_code = #{code} limit 1
</select>
2024-06-02 01:10:24 +00:00
<!-- 目的地名称 -->
<select id= "selectDestNameByCode" parameterType= "String" resultType= "string" >
select a.dest_name from emis_destination a where a.dest_code = #{code} and a.del_flag='0' limit 1
</select>
<!-- 查询客户名称(code) -->
<select id= "selectCustomerNameByCode" parameterType= "String" resultType= "string" >
select a.customer_name from emis_customer_user a where a.customer_code = #{code} limit 1
</select>
<!-- 查询月结客户名称(月结编码) -->
<select id= "selectCustNameByCustNo" parameterType= "String" resultType= "string" >
select a.customer_name from emis_customer_user a where a.monthly_pay_code = #{code} limit 1
</select>
<!-- 查询员工(emp_code) -->
<select id= "selectEmpNameByCode" parameterType= "String" resultType= "string" >
select a.emp_name from sys_user a where a.emp_code = #{code} limit 1
</select>
<!-- 查询员工(user_id) -->
<select id= "selectEmpNameByUserId" parameterType= "String" resultType= "string" >
select a.emp_name from sys_user a where a.user_id = #{id} limit 1
</select>
<!-- 查询品牌名称 -->
<select id= "selectBrandNameByCode" parameterType= "String" resultType= "string" >
select a.name from emis_brand a where a.code = #{code} limit 1
</select>
2024-06-03 08:59:49 +00:00
<!-- 查询问题件类型原型 -->
2024-06-06 07:07:25 +00:00
<select id= "selectProblemTypeNameById" parameterType= "int" resultType= "string" >
2024-06-03 08:59:49 +00:00
select a.type_name from emis_problem_type a where a.id = #{id} limit 1
</select>
2024-06-02 01:10:24 +00:00
</mapper>