<?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.stylefeng.guns.modular.system.dao.LineMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Line">
|
<id column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="shiftInterval" property="shiftInterval"/>
|
<result column="rakeRate" property="rakeRate"/>
|
<result column="state" property="state"/>
|
<result column="insertTime" property="insertTime"/>
|
</resultMap>
|
|
|
<select id="queryLines" resultType="map">
|
select
|
a.id as id,
|
a.name as name
|
from t_line a
|
left join t_line_site b on (a.id = b.lineId)
|
left join t_line_company c on (b.lineId = c.lineId)
|
where a.state = 1 and b.siteId = #{siteId} and b.type = #{type} and c.companyId = #{companyId}
|
</select>
|
|
|
<select id="queryLine" resultType="map">
|
select
|
a.id as id,
|
a.`name` as `name`
|
from t_line a
|
left join t_line_company b on (a.id = b.lineId)
|
where a.state = 1
|
<if test="null != companyId">
|
and b.companyId = #{companyId}
|
</if>
|
</select>
|
</mapper>
|