问题修改

This commit is contained in:
jiang 2025-09-16 18:27:18 +08:00
parent 8c16a8b9e7
commit 1e1db1892d
2 changed files with 216 additions and 176 deletions

View File

@ -1,75 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.devchange.mapper.MaDevInfoMapper"> <mapper namespace="com.bonus.material.devchange.mapper.MaDevInfoMapper">
<resultMap id="BaseResultMap" type="com.bonus.material.devchange.domain.MaDevInfo"> <resultMap id="BaseResultMap" type="com.bonus.material.devchange.domain.MaDevInfo">
<id column="ma_id" property="maId" /> <id column="ma_id" property="maId"/>
<result column="device_name" property="deviceName" /> <result column="device_name" property="deviceName"/>
<result column="device_weight" property="deviceWeight" /> <result column="device_weight" property="deviceWeight"/>
<result column="device_count" property="deviceCount" /> <result column="device_count" property="deviceCount"/>
<result column="code" property="code" /> <result column="code" property="code"/>
<result column="identify_code" property="identifyCode" /> <result column="identify_code" property="identifyCode"/>
<result column="type_id" property="typeId" /> <result column="type_id" property="typeId"/>
<result column="ma_status" property="maStatus" /> <result column="ma_status" property="maStatus"/>
<result column="lease_scope" property="leaseScope" /> <result column="lease_scope" property="leaseScope"/>
<result column="location" property="location" /> <result column="location" property="location"/>
<result column="brand" property="brand" /> <result column="brand" property="brand"/>
<result column="model_name" property="modelName" /> <result column="model_name" property="modelName"/>
<result column="production_date" property="productionDate" /> <result column="production_date" property="productionDate"/>
<result column="working_hours" property="workingHours" /> <result column="working_hours" property="workingHours"/>
<result column="serial_number" property="serialNumber" /> <result column="serial_number" property="serialNumber"/>
<result column="month_lease_price" property="monthLeasePrice" /> <result column="month_lease_price" property="monthLeasePrice"/>
<result column="day_lease_price" property="dayLeasePrice" /> <result column="day_lease_price" property="dayLeasePrice"/>
<result column="pic_url" property="picUrl" /> <result column="pic_url" property="picUrl"/>
<result column="js_month_price" property="jsMonthPrice" /> <result column="js_month_price" property="jsMonthPrice"/>
<result column="js_day_price" property="jsDayPrice" /> <result column="js_day_price" property="jsDayPrice"/>
<result column="description" property="description" /> <result column="description" property="description"/>
<result column="gps_code" property="gpsCode" /> <result column="gps_code" property="gpsCode"/>
<result column="own_co" property="ownCo" /> <result column="own_co" property="ownCo"/>
<result column="person" property="person" /> <result column="person" property="person"/>
<result column="person_phone" property="personPhone" /> <result column="person_phone" property="personPhone"/>
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime"/>
<result column="creator" property="creator" /> <result column="creator" property="creator"/>
<result column="deposit" property="deposit" /> <result column="deposit" property="deposit"/>
<result column="is_active" property="isActive" /> <result column="is_active" property="isActive"/>
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime"/>
<result column="update_by" property="updateBy" /> <result column="update_by" property="updateBy"/>
<result column="is_operator" property="isOperator" /> <result column="is_operator" property="isOperator"/>
<result column="specification" property="specification" /> <result column="specification" property="specification"/>
<result column="province_id" property="provinceId" /> <result column="province_id" property="provinceId"/>
<result column="city_id" property="cityId" /> <result column="city_id" property="cityId"/>
<result column="area_id" property="areaId" /> <result column="area_id" property="areaId"/>
<result column="video_url" property="videoUrl" /> <result column="video_url" property="videoUrl"/>
<result column="own_id" property="ownId" /> <result column="own_id" property="ownId"/>
<result column="check_date" property="checkDate" /> <result column="check_date" property="checkDate"/>
<result column="check_cycle" property="checkCycle" /> <result column="check_cycle" property="checkCycle"/>
<result column="is_qc" property="isQc" /> <result column="is_qc" property="isQc"/>
<result column="is_safe_book" property="isSafeBook" /> <result column="is_safe_book" property="isSafeBook"/>
<result column="is_zone" property="isZone" /> <result column="is_zone" property="isZone"/>
<result column="zone_id" property="zoneId" /> <result column="zone_id" property="zoneId"/>
<result column="total_up_day" property="totalUpDay" /> <result column="total_up_day" property="totalUpDay"/>
<result column="total_lease_day" property="totalLeaseDay" /> <result column="total_lease_day" property="totalLeaseDay"/>
<result column="origina_value" property="originaValue" /> <result column="origina_value" property="originaValue"/>
<result column="change_status" jdbcType="CHAR" property="changeStatus" /> <result column="change_status" jdbcType="CHAR" property="changeStatus"/>
<result column="expiration_time" jdbcType="DATE" property="expirationTime" /> <result column="expiration_time" jdbcType="DATE" property="expirationTime"/>
<result column="entry_status" jdbcType="CHAR" property="entryStatus" /> <result column="entry_status" jdbcType="CHAR" property="entryStatus"/>
<result column="up_down_status" jdbcType="CHAR" property="upDownStatus" /> <result column="up_down_status" jdbcType="CHAR" property="upDownStatus"/>
<result column="json_data" property="jsonData" /> <result column="json_data" property="jsonData"/>
<result column="buy_price" property="buyPrice" /> <result column="buy_price" property="buyPrice"/>
<result column="item_type_model" property="itemTypeModel" /> <result column="item_type_model" property="itemTypeModel"/>
<result column="on_project" property="onProject" /> <result column="on_project" property="onProject"/>
<result column="childGx" property="childGx"/> <result column="childGx" property="childGx"/>
<result column="company_name" property="companyName"/> <result column="company_name" property="companyName"/>
<result column="devCategory" property="devCategory"/> <result column="devCategory" property="devCategory"/>
<result column="devModel" property="devModel"/> <result column="devModel" property="devModel"/>
<result column="devName" property="devName"/> <result column="devName" property="devName"/>
<result column="devSubcategory" property="devSubcategory"/> <result column="devSubcategory" property="devSubcategory"/>
<result column="mainGx" property="mainGx"/> <result column="mainGx" property="mainGx"/>
<result column="next_check_time" property="nextCheckTime"/> <result column="next_check_time" property="nextCheckTime"/>
<result column="proType" property="proType"/> <result column="proType" property="proType"/>
<result column="unit_name" property="unitName"/> <result column="unit_name" property="unitName"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
ma_id, device_name, device_weight, device_count, code, identify_code, type_id, ma_status, ma_id, device_name, device_weight, device_count, code, identify_code, type_id, ma_status,
lease_scope, `location`, brand, model_name, production_date, working_hours, serial_number, lease_scope, `location`, brand, model_name, production_date, working_hours, serial_number,
month_lease_price, day_lease_price, pic_url, js_month_price, js_day_price, description, month_lease_price, day_lease_price, pic_url, js_month_price, js_day_price, description,
gps_code, own_co, person, person_phone, create_time, creator, deposit, is_active, gps_code, own_co, person, person_phone, create_time, creator, deposit, is_active,
@ -77,130 +77,169 @@
video_url, own_id, check_date, check_cycle, is_qc, is_safe_book, is_zone, zone_id, video_url, own_id, check_date, check_cycle, is_qc, is_safe_book, is_zone, zone_id,
total_up_day, total_lease_day, origina_value, change_status, expiration_time, entry_status, total_up_day, total_lease_day, origina_value, change_status, expiration_time, entry_status,
up_down_status, json_data, buy_price, item_type_model, on_project up_down_status, json_data, buy_price, item_type_model, on_project
</sql> </sql>
<select id="list" resultMap="BaseResultMap"> <select id="list" resultMap="BaseResultMap">
SELECT SELECT
mtv.proType, mtv.proType,
mtv.mainGx, mtv.mainGx,
mtv.childGx, mtv.childGx,
mtv.devCategory, mtv.devCategory,
mtv.devSubcategory, mtv.devSubcategory,
mtv.devName, mtv.devName,
mtv.devModel, mtv.devModel,
mtv.unit_name, mtv.unit_name,
mdi.ma_id, mdi.ma_id,
mdi.device_name, mdi.device_name,
mdi.model_name, mdi.model_name,
mdi.ma_status, mdi.ma_status,
mdi.`code`, mdi.`code`,
mdi.expiration_time, mdi.expiration_time,
c.company_name, c.company_name,
mdi.buy_price, mdi.buy_price,
mdi.production_date, mdi.production_date,
mdi.working_hours, mdi.working_hours,
mdi.on_project, mdi.on_project,
mdi.person, mdi.person,
mdi.person_phone, mdi.person_phone,
mdi.change_status, mdi.change_status,
mdi.up_down_status, mdi.up_down_status,
mdq.next_check_time, mdq.next_check_time,
mdi.brand, mdi.brand,
mdi.pic_url mdi.pic_url
FROM FROM
ma_dev_info mdi ma_dev_info mdi
LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
LEFT JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id LEFT JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id
WHERE mdi.is_active = 1 and mdi.entry_status = 1 WHERE mdi.is_active = 1 and mdi.entry_status = 1
<if test="typeId != null"> <if test="typeId != null">
and ( and (
mtv.mainGxId = #{typeId} mtv.mainGxId = #{typeId}
or mtv.childGxId = #{typeId} or mtv.childGxId = #{typeId}
or mtv.devCategoryId = #{typeId} or mtv.devCategoryId = #{typeId}
or mtv.devSubcategoryId = #{typeId} or mtv.devSubcategoryId = #{typeId}
or mtv.devNameId = #{typeId} or mtv.devNameId = #{typeId}
or mtv.devModelId = #{typeId} or mtv.devModelId = #{typeId}
or mtv.maxTypeId = #{typeId} or mtv.maxTypeId = #{typeId}
) )
</if> </if>
</select> <if test="companyName != null and companyName !=''">
and c.company_name like concat('%',#{companyName},'%')
</if>
<if test="onProject != null and onProject !=''">
and mdi.on_project like concat('%',#{onProject},'%')
</if>
<update id="updateDeviceStatus"> <if test="deviceName != null and deviceName !=''">
<foreach collection="list" item="data" index="index" separator=";"> and mtv.devName like concat('%',#{deviceName},'%')
UPDATE ma_dev_info SET up_down_status = #{data.value} where ma_id =#{data.key} </if>
</foreach>
</update>
<select id="delDevice" resultType="java.lang.Integer"> <if test="code != null and code !=''">
UPDATE ma_dev_info SET is_active = 0 where ma_id in and mdi.`code` like concat('%',#{code},'%')
<foreach item="item" index="index" collection="list" separator="," close=")" open="("> </if>
#{item}
</foreach>
</select>
<select id="deviceTree" resultType="com.bonus.material.devchange.domain.DeviceTreeBean"> <if test="changeStatus != null and changeStatus !=''">
SELECT and mdi.ma_status like concat('%',#{changeStatus},'%')
mt.type_id as id, </if>
mt.type_name as name,
mt.level,
mt.parent_id as pId
FROM
ma_type mt
</select>
<select id="deviceCount" resultType="com.bonus.material.devchange.domain.DeviceCountBean"> <if test="brand != null and brand !=''">
SELECT and mdi.brand like concat('%',#{brand},'%')
</if>
<if test="productionDate != null and productionDate !=''">
and mdi.production_date like concat('%',#{brand},'%')
</if>
<if test="workingHours != null and workingHours !=''">
and mdi.working_hours like concat('%',#{workingHours},'%')
</if>
<if test="buyPrice != null and buyPrice !=''">
and mdi.buy_price like concat('%',#{buyPrice},'%')
</if>
<if test="nextCheckTime != null and nextCheckTime !=''">
and mdq.next_check_time like concat('%',#{nextCheckTime},'%')
</if>
</select>
<update id="updateDeviceStatus">
<foreach collection="list" item="data" index="index" separator=";">
UPDATE ma_dev_info SET up_down_status = #{data.value} where ma_id =#{data.key}
</foreach>
</update>
<select id="delDevice" resultType="java.lang.Integer">
UPDATE ma_dev_info SET is_active = 0 where ma_id in
<foreach item="item" index="index" collection="list" separator="," close=")" open="(">
#{item}
</foreach>
</select>
<select id="deviceTree" resultType="com.bonus.material.devchange.domain.DeviceTreeBean">
SELECT mt.type_id as id,
mt.type_name as name,
mt.level,
mt.parent_id as pId
FROM ma_type mt
</select>
<select id="deviceCount" resultType="com.bonus.material.devchange.domain.DeviceCountBean">
SELECT
count(distinct if(mdi.change_status = '1', mdi.ma_id, null)) as inStock, count(distinct if(mdi.change_status = '1', mdi.ma_id, null)) as inStock,
count(distinct if(mdi.change_status = '2', mdi.ma_id, null)) as ownUse, count(distinct if(mdi.change_status = '2', mdi.ma_id, null)) as ownUse,
count(distinct if(mdi.change_status = '3', mdi.ma_id, null)) as share, count(distinct if(mdi.change_status = '3', mdi.ma_id, null)) as share,
count(distinct if(mdi.change_status = '5', mdi.ma_id, null)) as underRepair count(distinct if(mdi.change_status = '5', mdi.ma_id, null)) as underRepair
FROM FROM
ma_dev_info mdi ma_dev_info mdi
LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
LEFT JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id LEFT JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id
WHERE mdi.is_active = 1 WHERE mdi.is_active = 1
<if test="typeId != null"> <if test="typeId != null">
and ( and (
mtv.mainGxId = #{typeId} mtv.mainGxId = #{typeId}
or mtv.childGxId = #{typeId} or mtv.childGxId = #{typeId}
or mtv.devCategoryId = #{typeId} or mtv.devCategoryId = #{typeId}
or mtv.devSubcategoryId = #{typeId} or mtv.devSubcategoryId = #{typeId}
or mtv.devNameId = #{typeId} or mtv.devNameId = #{typeId}
or mtv.devModelId = #{typeId} or mtv.devModelId = #{typeId}
or mtv.maxTypeId = #{typeId} or mtv.maxTypeId = #{typeId}
) )
</if> </if>
</select> </select>
<select id="getProperties" resultType="com.bonus.material.device.domain.vo.DevInfoPropertyVo"> <select id="getProperties" resultType="com.bonus.material.device.domain.vo.DevInfoPropertyVo">
select property_name propertyName,property_value propertyValue select property_name propertyName, property_value propertyValue
from ma_dev_info_properties from ma_dev_info_properties
where ma_id=#{maId} where ma_id = #{maId}
</select> </select>
<select id="deviceLocationSel" resultType="com.bonus.material.devchange.domain.MapBean"> <select id="deviceLocationSel" resultType="com.bonus.material.devchange.domain.MapBean">
SELECT SELECT '0' as `key`,
'0' as `key`, location as `value`
location as `value` FROM ma_dev_info
FROM WHERE is_active = 1
ma_dev_info </select>
WHERE is_active = 1
</select>
<select id="companySel" resultType="com.bonus.material.devchange.domain.MapBean"> <select id="companySel" resultType="com.bonus.material.devchange.domain.MapBean">
SELECT SELECT
bci.id as `key`, bci.id as `key`,
bci.company_name as `value` bci.company_name as `value`
FROM FROM
bm_company_info bci bm_company_info bci
<where> <where>
<if test="id != null"> <if test="id != null">
and bci.id = #{id} and bci.id = #{id}
</if> </if>
</where> </where>
</select> </select>
</mapper> </mapper>

View File

@ -137,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
</if> </if>
and d.is_active='1' and d.is_active='1'
and d.up_down_status ='1'
</where> </where>
order by order by
d.is_active d.is_active