|
|
@ -1,60 +1,85 @@
|
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.os.mes.base.mapper.BaseDeviceLedgerMapper">
|
|
|
|
<mapper namespace="com.os.mes.base.mapper.BaseDeviceLedgerMapper">
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap type="BaseDeviceLedger" id="BaseDeviceLedgerResult">
|
|
|
|
<resultMap type="BaseDeviceLedger" id="BaseDeviceLedgerResult">
|
|
|
|
<result property="objId" column="obj_id" />
|
|
|
|
<result property="objId" column="obj_id"/>
|
|
|
|
<result property="deviceCode" column="device_code" />
|
|
|
|
<result property="deviceCode" column="device_code"/>
|
|
|
|
<result property="deviceName" column="device_name" />
|
|
|
|
<result property="deviceName" column="device_name"/>
|
|
|
|
<result property="deviceModel" column="device_model" />
|
|
|
|
<result property="deviceModel" column="device_model"/>
|
|
|
|
<result property="deviceType" column="device_type" />
|
|
|
|
<result property="deviceType" column="device_type"/>
|
|
|
|
<result property="deviceAddress" column="device_address" />
|
|
|
|
<result property="deviceAddress" column="device_address"/>
|
|
|
|
<result property="deviceStatus" column="device_status" />
|
|
|
|
<result property="deviceStatus" column="device_status"/>
|
|
|
|
<result property="usedDepartment" column="used_department" />
|
|
|
|
<result property="usedDepartment" column="used_department"/>
|
|
|
|
<result property="costCenter" column="cost_center" />
|
|
|
|
<result property="costCenter" column="cost_center"/>
|
|
|
|
<result property="manufacturer" column="manufacturer" />
|
|
|
|
<result property="manufacturer" column="manufacturer"/>
|
|
|
|
<result property="enableDate" column="enable_date" />
|
|
|
|
<result property="enableDate" column="enable_date"/>
|
|
|
|
<result property="productLineCode" column="product_line_code" />
|
|
|
|
<result property="productLineCode" column="product_line_code"/>
|
|
|
|
<result property="isFlag" column="is_flag" />
|
|
|
|
<result property="productLineName" column="product_line_name"/>
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="isFlag" column="is_flag"/>
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="teamCode" column="team_code" />
|
|
|
|
<result property="factoryCode" column="factory_code"/>
|
|
|
|
<result property="assetCode" column="asset_code" />
|
|
|
|
<result property="teamCode" column="team_code"/>
|
|
|
|
|
|
|
|
<result property="assetCode" column="asset_code"/>
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectBaseDeviceLedgerVo">
|
|
|
|
<sql id="selectBaseDeviceLedgerVo">
|
|
|
|
select obj_id, device_code, device_name, device_model, device_type, device_address, device_status, used_department, cost_center, manufacturer, enable_date, product_line_code, is_flag, create_by, create_time, update_by, update_time, factory_code, team_code, asset_code from base_device_ledger
|
|
|
|
select bdl.obj_id,
|
|
|
|
|
|
|
|
bdl.device_code,
|
|
|
|
|
|
|
|
bdl.device_name,
|
|
|
|
|
|
|
|
bdl.device_model,
|
|
|
|
|
|
|
|
bdl.device_type,
|
|
|
|
|
|
|
|
bdl.device_address,
|
|
|
|
|
|
|
|
bdl.device_status,
|
|
|
|
|
|
|
|
bdl.used_department,
|
|
|
|
|
|
|
|
bdl.cost_center,
|
|
|
|
|
|
|
|
bdl.manufacturer,
|
|
|
|
|
|
|
|
bdl.enable_date,
|
|
|
|
|
|
|
|
bdl.product_line_code,
|
|
|
|
|
|
|
|
bpl.product_line_name,
|
|
|
|
|
|
|
|
bdl.is_flag,
|
|
|
|
|
|
|
|
bdl.create_by,
|
|
|
|
|
|
|
|
bdl.create_time,
|
|
|
|
|
|
|
|
bdl.update_by,
|
|
|
|
|
|
|
|
bdl.update_time,
|
|
|
|
|
|
|
|
bdl.factory_code,
|
|
|
|
|
|
|
|
bdl.team_code,
|
|
|
|
|
|
|
|
bdl.asset_code
|
|
|
|
|
|
|
|
from base_device_ledger bdl
|
|
|
|
|
|
|
|
left join base_product_line bpl on bpl.product_line_code = bdl.product_line_code
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseDeviceLedgerList" parameterType="BaseDeviceLedger" resultMap="BaseDeviceLedgerResult">
|
|
|
|
<select id="selectBaseDeviceLedgerList" parameterType="BaseDeviceLedger" resultMap="BaseDeviceLedgerResult">
|
|
|
|
<include refid="selectBaseDeviceLedgerVo"/>
|
|
|
|
<include refid="selectBaseDeviceLedgerVo"/>
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
|
|
|
<if test="deviceCode != null and deviceCode != ''">and bdl.device_code = #{deviceCode}</if>
|
|
|
|
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
|
|
|
<if test="deviceName != null and deviceName != ''">and bdl.device_name like concat('%', #{deviceName}, '%')
|
|
|
|
<if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
|
|
|
|
</if>
|
|
|
|
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
|
|
|
|
<if test="deviceModel != null and deviceModel != ''">and bdl.device_model = #{deviceModel}</if>
|
|
|
|
<if test="deviceAddress != null and deviceAddress != ''"> and device_address = #{deviceAddress}</if>
|
|
|
|
<if test="deviceType != null and deviceType != ''">and bdl.device_type = #{deviceType}</if>
|
|
|
|
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
|
|
|
|
<if test="deviceAddress != null and deviceAddress != ''">and bdl.device_address = #{deviceAddress}</if>
|
|
|
|
<if test="usedDepartment != null and usedDepartment != ''"> and used_department = #{usedDepartment}</if>
|
|
|
|
<if test="deviceStatus != null and deviceStatus != ''">and bdl.device_status = #{deviceStatus}</if>
|
|
|
|
<if test="costCenter != null and costCenter != ''"> and cost_center = #{costCenter}</if>
|
|
|
|
<if test="usedDepartment != null and usedDepartment != ''">and bdl.used_department = #{usedDepartment}</if>
|
|
|
|
<if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
|
|
|
|
<if test="costCenter != null and costCenter != ''">and bdl.cost_center = #{costCenter}</if>
|
|
|
|
<if test="enableDate != null "> and enable_date = #{enableDate}</if>
|
|
|
|
<if test="manufacturer != null and manufacturer != ''">and bdl.manufacturer = #{manufacturer}</if>
|
|
|
|
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
|
|
|
|
<if test="enableDate != null ">and bdl.enable_date = #{enableDate}</if>
|
|
|
|
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">and bdl.product_line_code = #{productLineCode}
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
</if>
|
|
|
|
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
|
|
|
|
<if test="isFlag != null and isFlag != ''">and bdl.is_flag = #{isFlag}</if>
|
|
|
|
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and bdl.factory_code = #{factoryCode}</if>
|
|
|
|
|
|
|
|
<if test="teamCode != null and teamCode != ''">and bdl.team_code = #{teamCode}</if>
|
|
|
|
|
|
|
|
<if test="assetCode != null and assetCode != ''">and bdl.asset_code = #{assetCode}</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseDeviceLedgerByObjId" parameterType="Long" resultMap="BaseDeviceLedgerResult">
|
|
|
|
<select id="selectBaseDeviceLedgerByObjId" parameterType="Long" resultMap="BaseDeviceLedgerResult">
|
|
|
|
<include refid="selectBaseDeviceLedgerVo"/>
|
|
|
|
<include refid="selectBaseDeviceLedgerVo"/>
|
|
|
|
where obj_id = #{objId}
|
|
|
|
where bdl.obj_id = #{objId}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger" useGeneratedKeys="true" keyProperty="objId">
|
|
|
|
<insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger" useGeneratedKeys="true" keyProperty="objId">
|
|
|
@ -130,7 +155,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long">
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long">
|
|
|
|
delete from base_device_ledger where obj_id = #{objId}
|
|
|
|
delete
|
|
|
|
|
|
|
|
from base_device_ledger
|
|
|
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
</delete>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String">
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String">
|
|
|
|