|
|
@ -5,123 +5,150 @@
|
|
|
|
<mapper namespace="com.aucma.base.mapper.BaseDeviceLedgerMapper">
|
|
|
|
<mapper namespace="com.aucma.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="productLineCode" column="product_line_code" />
|
|
|
|
<result property="productLineCode" column="product_line_code"/>
|
|
|
|
<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="isFlag" column="is_flag" />
|
|
|
|
<result property="isFlag" column="is_flag"/>
|
|
|
|
<result property="createdBy" column="created_by" />
|
|
|
|
<result property="createdBy" column="created_by"/>
|
|
|
|
<result property="createdTime" column="created_time" />
|
|
|
|
<result property="createdTime" column="created_time"/>
|
|
|
|
<result property="updatedBy" column="updated_by" />
|
|
|
|
<result property="updatedBy" column="updated_by"/>
|
|
|
|
<result property="updatedTime" column="updated_time" />
|
|
|
|
<result property="updatedTime" column="updated_time"/>
|
|
|
|
|
|
|
|
<result property="factoryCode" column="factory_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, created_by, created_time, updated_by, updated_time from base_deviceledger
|
|
|
|
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,
|
|
|
|
|
|
|
|
factory_code,
|
|
|
|
|
|
|
|
is_flag,
|
|
|
|
|
|
|
|
created_by,
|
|
|
|
|
|
|
|
created_time,
|
|
|
|
|
|
|
|
updated_by,
|
|
|
|
|
|
|
|
updated_time
|
|
|
|
|
|
|
|
from base_deviceledger
|
|
|
|
</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 device_code = #{deviceCode}</if>
|
|
|
|
<if test="deviceName != null and deviceName != ''"> and device_name like concat(concat('%', #{deviceName}), '%')</if>
|
|
|
|
<if test="deviceName != null and deviceName != ''">and device_name like concat(concat('%', #{deviceName}),
|
|
|
|
<if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
|
|
|
|
'%')
|
|
|
|
<if test="deviceType != null "> and device_type = #{deviceType}</if>
|
|
|
|
</if>
|
|
|
|
<if test="deviceAddress != null and deviceAddress != ''"> and device_address = #{deviceAddress}</if>
|
|
|
|
<if test="deviceModel != null and deviceModel != ''">and device_model = #{deviceModel}</if>
|
|
|
|
<if test="deviceStatus != null "> and device_status = #{deviceStatus}</if>
|
|
|
|
<if test="deviceType != null ">and device_type = #{deviceType}</if>
|
|
|
|
<if test="usedDepartment != null and usedDepartment != ''"> and used_department = #{usedDepartment}</if>
|
|
|
|
<if test="deviceAddress != null and deviceAddress != ''">and device_address = #{deviceAddress}</if>
|
|
|
|
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
|
|
|
|
<if test="deviceStatus != null ">and device_status = #{deviceStatus}</if>
|
|
|
|
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
|
|
|
|
<if test="usedDepartment != null and usedDepartment != ''">and used_department = #{usedDepartment}</if>
|
|
|
|
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">and product_line_code = #{productLineCode}
|
|
|
|
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
|
|
|
</if>
|
|
|
|
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
|
|
|
<if test="isFlag != null ">and is_flag = #{isFlag}</if>
|
|
|
|
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
|
|
|
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
|
|
|
|
|
|
|
|
<if test="createdTime != null ">and created_time = #{createdTime}</if>
|
|
|
|
|
|
|
|
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
|
|
|
|
|
|
|
|
<if test="updatedTime != null ">and updated_time = #{updatedTime}</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 obj_id = #{objId}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger">
|
|
|
|
<insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger">
|
|
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
|
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
|
|
|
SELECT seq_base_deviceledger.NEXTVAL as objId FROM DUAL
|
|
|
|
SELECT seq_base_deviceledger.NEXTVAL as objId FROM DUAL
|
|
|
|
</selectKey>
|
|
|
|
</selectKey>
|
|
|
|
insert into base_deviceledger
|
|
|
|
insert into base_deviceledger
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="objId != null">obj_id,</if>
|
|
|
|
<if test="objId != null">obj_id,</if>
|
|
|
|
<if test="deviceCode != null">device_code,</if>
|
|
|
|
<if test="deviceCode != null">device_code,</if>
|
|
|
|
<if test="deviceName != null">device_name,</if>
|
|
|
|
<if test="deviceName != null">device_name,</if>
|
|
|
|
<if test="deviceModel != null">device_model,</if>
|
|
|
|
<if test="deviceModel != null">device_model,</if>
|
|
|
|
<if test="deviceType != null">device_type,</if>
|
|
|
|
<if test="deviceType != null">device_type,</if>
|
|
|
|
<if test="deviceAddress != null">device_address,</if>
|
|
|
|
<if test="deviceAddress != null">device_address,</if>
|
|
|
|
<if test="deviceStatus != null">device_status,</if>
|
|
|
|
<if test="deviceStatus != null">device_status,</if>
|
|
|
|
<if test="usedDepartment != null">used_department,</if>
|
|
|
|
<if test="usedDepartment != null">used_department,</if>
|
|
|
|
<if test="productLineCode != null">product_line_code,</if>
|
|
|
|
<if test="productLineCode != null">product_line_code,</if>
|
|
|
|
<if test="costCenter != null">cost_center,</if>
|
|
|
|
<if test="costCenter != null">cost_center,</if>
|
|
|
|
<if test="manufacturer != null">manufacturer,</if>
|
|
|
|
<if test="manufacturer != null">manufacturer,</if>
|
|
|
|
<if test="enableDate != null">enable_date,</if>
|
|
|
|
<if test="enableDate != null">enable_date,</if>
|
|
|
|
<if test="isFlag != null">is_flag,</if>
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
<if test="createdBy != null">created_by,</if>
|
|
|
|
<if test="isFlag != null">is_flag,</if>
|
|
|
|
<if test="createdTime != null">created_time,</if>
|
|
|
|
<if test="createdBy != null">created_by,</if>
|
|
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
|
|
<if test="createdTime != null">created_time,</if>
|
|
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
|
|
|
|
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="objId != null">#{objId},</if>
|
|
|
|
<if test="objId != null">#{objId},</if>
|
|
|
|
<if test="deviceCode != null">#{deviceCode},</if>
|
|
|
|
<if test="deviceCode != null">#{deviceCode},</if>
|
|
|
|
<if test="deviceName != null">#{deviceName},</if>
|
|
|
|
<if test="deviceName != null">#{deviceName},</if>
|
|
|
|
<if test="deviceModel != null">#{deviceModel},</if>
|
|
|
|
<if test="deviceModel != null">#{deviceModel},</if>
|
|
|
|
<if test="deviceType != null">#{deviceType},</if>
|
|
|
|
<if test="deviceType != null">#{deviceType},</if>
|
|
|
|
<if test="deviceAddress != null">#{deviceAddress},</if>
|
|
|
|
<if test="deviceAddress != null">#{deviceAddress},</if>
|
|
|
|
<if test="deviceStatus != null">#{deviceStatus},</if>
|
|
|
|
<if test="deviceStatus != null">#{deviceStatus},</if>
|
|
|
|
<if test="usedDepartment != null">#{usedDepartment},</if>
|
|
|
|
<if test="usedDepartment != null">#{usedDepartment},</if>
|
|
|
|
<if test="productLineCode != null">#{productLineCode},</if>
|
|
|
|
<if test="productLineCode != null">#{productLineCode},</if>
|
|
|
|
<if test="costCenter != null">cost_center,</if>
|
|
|
|
<if test="costCenter != null">#{costCenter},</if>
|
|
|
|
<if test="manufacturer != null">manufacturer,</if>
|
|
|
|
<if test="manufacturer != null">#{manufacturer},</if>
|
|
|
|
<if test="enableDate != null">enable_date,</if>
|
|
|
|
<if test="enableDate != null">#{enableDate},</if>
|
|
|
|
<if test="isFlag != null">#{isFlag},</if>
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
|
<if test="isFlag != null">#{isFlag},</if>
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateBaseDeviceLedger" parameterType="BaseDeviceLedger">
|
|
|
|
<update id="updateBaseDeviceLedger" parameterType="BaseDeviceLedger">
|
|
|
|
update base_deviceledger
|
|
|
|
update base_deviceledger
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
|
|
|
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
|
|
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
|
|
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
|
|
|
<if test="deviceModel != null">device_model = #{deviceModel},</if>
|
|
|
|
<if test="deviceModel != null">device_model = #{deviceModel},</if>
|
|
|
|
<if test="deviceType != null">device_type = #{deviceType},</if>
|
|
|
|
<if test="deviceType != null">device_type = #{deviceType},</if>
|
|
|
|
<if test="deviceAddress != null">device_address = #{deviceAddress},</if>
|
|
|
|
<if test="deviceAddress != null">device_address = #{deviceAddress},</if>
|
|
|
|
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
|
|
|
|
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
|
|
|
|
<if test="usedDepartment != null">used_department = #{usedDepartment},</if>
|
|
|
|
<if test="usedDepartment != null">used_department = #{usedDepartment},</if>
|
|
|
|
<if test="costCenter != null">#{costCenter},</if>
|
|
|
|
<if test="costCenter != null">cost_center = #{costCenter},</if>
|
|
|
|
<if test="manufacturer != null">#{manufacturer},</if>
|
|
|
|
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
|
|
|
<if test="enableDate != null">#{enableDate},</if>
|
|
|
|
<if test="enableDate != null">enable_date = #{enableDate},</if>
|
|
|
|
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
|
|
|
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
|
|
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
|
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
|
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
|
|
|
|
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
where obj_id = #{objId}
|
|
|
|
where obj_id = #{objId}
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long">
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long">
|
|
|
|
delete from base_deviceledger where obj_id = #{objId}
|
|
|
|
delete
|
|
|
|
|
|
|
|
from base_deviceledger
|
|
|
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
</delete>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String">
|
|
|
|
<delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String">
|
|
|
|