|
|
|
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="tyreNo" column="tyre_no" />
|
|
|
|
|
<result property="selfNo" column="self_no" />
|
|
|
|
|
<result property="tyreEpc" column="tyre_epc" />
|
|
|
|
|
<result property="inboundCode" column="inbound_code" />
|
|
|
|
|
<result property="tyreBrand" column="tyre_brand" />
|
|
|
|
|
<result property="tyreModel" column="tyre_model" />
|
|
|
|
|
<result property="tyreLevel" column="tyre_level" />
|
|
|
|
|
@ -32,10 +33,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
<sql id="selectBaseTyreVo">
|
|
|
|
|
select d.tyre_id, d.tyre_no, d.self_no, d.tyre_epc, d.tyre_brand, d.tyre_model, d.tyre_level, d.tyre_pattern,
|
|
|
|
|
d.grooves, d.pattern_depth, d.tyre_type, d.team, d.create_by, d.create_time, d.update_by, d.update_time,
|
|
|
|
|
d.remark, d.car_no, d.wheel_postion, d.dept_id, sd.dept_name
|
|
|
|
|
d.grooves, d.pattern_depth, d.tyre_type, d.team, d.inbound_code, d.create_by, d.create_time, d.update_by, d.update_time,
|
|
|
|
|
d.remark, d.car_no, d.wheel_postion, d.dept_id, tyre_dept.dept_name,
|
|
|
|
|
company_dept.dept_name as company, car_dept.dept_name as carTeam
|
|
|
|
|
from base_tyre d
|
|
|
|
|
left join sys_dept sd on sd.dept_id = d.dept_id
|
|
|
|
|
<!-- 详情页与 tyre.html 列表页保持同一口径:公司/车队跟随当前安装车辆,修理厂跟随轮胎档案 team。 -->
|
|
|
|
|
left join base_car bc on bc.car_no = d.car_no
|
|
|
|
|
left join sys_dept car_dept on car_dept.dept_id = bc.dept_id
|
|
|
|
|
left join sys_dept repair_dept on repair_dept.dept_id = car_dept.parent_id
|
|
|
|
|
left join sys_dept company_dept on company_dept.dept_id = repair_dept.parent_id
|
|
|
|
|
left join sys_dept tyre_dept on tyre_dept.dept_id = d.dept_id
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseTyreList" parameterType="BaseTyre" resultMap="BaseTyreResult">
|
|
|
|
|
@ -44,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
tyre_no,
|
|
|
|
|
self_no,
|
|
|
|
|
tyre_epc,
|
|
|
|
|
d.inbound_code,
|
|
|
|
|
tyre_brand,
|
|
|
|
|
tyre_model,
|
|
|
|
|
tyre_level,
|
|
|
|
|
@ -71,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="tyreNo != null and tyreNo != ''"> and tyre_no like concat('%', #{tyreNo}, '%')</if>
|
|
|
|
|
<if test="selfNo != null and selfNo != ''"> and self_no like concat('%', #{selfNo}, '%')</if>
|
|
|
|
|
<if test="tyreEpc != null and tyreEpc != ''"> and tyre_epc like concat('%', #{tyreEpc}, '%')</if>
|
|
|
|
|
<if test="inboundCode != null and inboundCode != ''"> and d.inbound_code = #{inboundCode}</if>
|
|
|
|
|
<if test="tyreBrand != null and tyreBrand != ''"> and tyre_brand like concat('%', #{tyreBrand}, '%')</if>
|
|
|
|
|
<if test="tyreModel != null and tyreModel != ''"> and tyre_model = #{tyreModel}</if>
|
|
|
|
|
<if test="tyreLevel != null and tyreLevel != ''"> and tyre_level = #{tyreLevel}</if>
|
|
|
|
|
@ -101,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="tyreEpc != null and tyreEpc != ''"> and d.tyre_epc like concat('%', #{tyreEpc}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getTeamByUser" resultType="java.lang.String">
|
|
|
|
|
SELECT
|
|
|
|
|
dept_name
|
|
|
|
|
@ -135,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="tyreNo != null and tyreNo != ''">tyre_no,</if>
|
|
|
|
|
<if test="selfNo != null and selfNo != ''">self_no,</if>
|
|
|
|
|
<if test="tyreEpc != null and tyreEpc != ''">tyre_epc,</if>
|
|
|
|
|
<if test="inboundCode != null and inboundCode != ''">inbound_code,</if>
|
|
|
|
|
<if test="tyreBrand != null and tyreBrand != ''">tyre_brand,</if>
|
|
|
|
|
<if test="tyreModel != null and tyreModel != ''">tyre_model,</if>
|
|
|
|
|
<if test="tyreLevel != null and tyreLevel != ''">tyre_level,</if>
|
|
|
|
|
@ -155,6 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="tyreNo != null and tyreNo != ''">#{tyreNo},</if>
|
|
|
|
|
<if test="selfNo != null and selfNo != ''">#{selfNo},</if>
|
|
|
|
|
<if test="tyreEpc != null and tyreEpc != ''">#{tyreEpc},</if>
|
|
|
|
|
<if test="inboundCode != null and inboundCode != ''">#{inboundCode},</if>
|
|
|
|
|
<if test="tyreBrand != null and tyreBrand != ''">#{tyreBrand},</if>
|
|
|
|
|
<if test="tyreModel != null and tyreModel != ''">#{tyreModel},</if>
|
|
|
|
|
<if test="tyreLevel != null and tyreLevel != ''">#{tyreLevel},</if>
|
|
|
|
|
@ -178,6 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="tyreNo != null and tyreNo != ''">tyre_no = #{tyreNo},</if>
|
|
|
|
|
<if test="selfNo != null and selfNo != ''">self_no = #{selfNo},</if>
|
|
|
|
|
<if test="tyreEpc != null and tyreEpc != ''">tyre_epc = #{tyreEpc},</if>
|
|
|
|
|
<if test="inboundCode != null and inboundCode != ''">inbound_code = #{inboundCode},</if>
|
|
|
|
|
<if test="tyreBrand != null and tyreBrand != ''">tyre_brand = #{tyreBrand},</if>
|
|
|
|
|
<if test="tyreModel != null and tyreModel != ''">tyre_model = #{tyreModel},</if>
|
|
|
|
|
<if test="tyreLevel != null and tyreLevel != ''">tyre_level = #{tyreLevel},</if>
|
|
|
|
|
@ -207,4 +220,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectByInboundCode" resultMap="BaseTyreResult">
|
|
|
|
|
<include refid="selectBaseTyreVo"/>
|
|
|
|
|
where d.inbound_code = #{inboundCode}
|
|
|
|
|
and d.tyre_epc is not null
|
|
|
|
|
and d.tyre_epc <> ''
|
|
|
|
|
order by d.tyre_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="countBaseTyreByInboundCode" resultType="int">
|
|
|
|
|
select count(1)
|
|
|
|
|
from base_tyre
|
|
|
|
|
where inbound_code = #{inboundCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|