<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
~
|
~ Copyright (c) 2018-2025, ztt All rights reserved.
|
~
|
~ Redistribution and use in source and binary forms, with or without
|
~ modification, are permitted provided that the following conditions are met:
|
~
|
~ Redistributions of source code must retain the above copyright notice,
|
~ this list of conditions and the following disclaimer.
|
~ Redistributions in binary form must reproduce the above copyright
|
~ notice, this list of conditions and the following disclaimer in the
|
~ documentation and/or other materials provided with the distribution.
|
~ Neither the name of the pig4cloud.com developer nor the names of its
|
~ contributors may be used to endorse or promote products derived from
|
~ this software without specific prior written permission.
|
~ Author: ztt
|
~
|
-->
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.chinaztt.mes.basic.mapper.DiscToolMapper">
|
<resultMap id="basicDiscToolMap" type="com.chinaztt.mes.basic.entity.DiscTool">
|
<id property="id" column="id"/>
|
<result property="discNumber" column="disc_number"/>
|
<result property="partId" column="part_id"/>
|
<result property="partNo" column="part_no"/>
|
<result property="partName" column="part_name"/>
|
<result property="texture" column="texture"/>
|
<result property="measurement" column="measurement"/>
|
<result property="discLength" column="disc_length"/>
|
<result property="minLength" column="min_length"/>
|
<result property="maxLength" column="max_length"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="createUser" column="create_user"/>
|
<result property="updateUser" column="update_user"/>
|
</resultMap>
|
|
<select id="selectListByPartIdAndLengths" resultMap="basicDiscToolMap">
|
SELECT * FROM basic_disc_tool
|
WHERE
|
part_id = #{partId}
|
<if test="minLength != null and maxLength != null">
|
AND (
|
( #{minLength} BETWEEN min_length AND max_length
|
OR #{maxLength} BETWEEN min_length AND max_length )
|
OR ( min_length BETWEEN #{minLength} AND #{maxLength}
|
OR max_length BETWEEN #{minLength} AND #{maxLength} ))
|
</if>
|
<if test="excludeId != null">
|
AND id != #{excludeId}
|
</if>
|
<if test="discLength != null">
|
AND min_length <= #{discLength}
|
AND max_length >= #{discLength}
|
</if>
|
</select>
|
</mapper>
|