去冲冗余参数,修改对应mapper
This commit is contained in:
parent
59d67fbadc
commit
d6c8a97237
|
|
@ -278,8 +278,6 @@ public interface DevInfoMapper {
|
|||
|
||||
List<SysDept> getDemandUnit(DevInfoVo devInfoVo);
|
||||
|
||||
int updateTypeLeasePrice(DevInfo devInfo);
|
||||
|
||||
Integer getTotalEquipment(DevInfoReq devInfoReq);
|
||||
|
||||
BigDecimal getTotalValue(DevInfoReq devInfoReq);
|
||||
|
|
|
|||
|
|
@ -614,7 +614,6 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
String identifyCode = tableList.get(0).getIdentifyCode();
|
||||
devInfo.setIdentifyCode(identifyCode);
|
||||
int i = devInfoMapper.updateDevInfo(devInfo);
|
||||
devInfoMapper.updateTypeLeasePrice(devInfo);
|
||||
|
||||
if (i > 0) {
|
||||
BmFileInfo bmFileInfo = new BmFileInfo()
|
||||
|
|
|
|||
|
|
@ -26,18 +26,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.ma_id as maId,
|
||||
d.code as code,
|
||||
d.device_name as deviceName,
|
||||
d.device_weight as deviceWeight,
|
||||
d.device_count as deviceCount,
|
||||
d.type_id as typeId,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
mt.type_name as typeName,
|
||||
mt.manage_type as manageType,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
c.company_name as companyName,
|
||||
|
|
@ -47,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bcd.order_user as orderUser,
|
||||
bcd.address as address
|
||||
FROM ma_dev_info d
|
||||
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||
LEFT JOIN bm_company_info c ON d.on_company = c.company_id
|
||||
LEFT JOIN book_car_detail bcd ON d.ma_id = bcd.ma_id
|
||||
LEFT JOIN ma_type mt ON d.type_id = mt.type_id and mt.del_flag = '0'
|
||||
where d.is_active = '1' and bcd.order_status = '0'
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(sum( buy_price * device_count ),0) AS totalValue
|
||||
FROM
|
||||
ma_dev_info
|
||||
WHERE is_active = 1 and own_co = #{companyId}
|
||||
WHERE is_active = 1 and on_company = #{companyId}
|
||||
</select>
|
||||
|
||||
<select id="getTodayDeviceEnterOutNum" resultType="com.bonus.material.cityScreen.VO.BasicTitleVO">
|
||||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
COUNT(1) as deviceQuantity
|
||||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1 and mtv.MaxTypeId = #{typeId} and mdi.own_co = #{companyId}
|
||||
where mdi.is_active = 1 and mtv.MaxTypeId = #{typeId} and mdi.on_company = #{companyId}
|
||||
<if test="year == 1">
|
||||
and TIMESTAMPDIFF(YEAR,mdi.production_date, NOW()) <![CDATA[ < ]]> 5
|
||||
</if>
|
||||
|
|
@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mtv.maxTypeId as typeId
|
||||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId}
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId}
|
||||
<if test="typeId != null">
|
||||
and mtv.MaxTypeId = #{typeId}
|
||||
</if>
|
||||
|
|
@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
left join ma_dev_qc mdq on mdq.ma_id = mdi.ma_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status != 4
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status != 4
|
||||
order by TIMESTAMPDIFF(YEAR, NOW(),mdq.next_check_time)
|
||||
</select>
|
||||
<select id="countMaintenanceAlarm" resultType="int">
|
||||
|
|
@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
left join ma_dev_qc mdq on mdq.ma_id = mdi.ma_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status != 4
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status != 4
|
||||
</select>
|
||||
<select id="retirementAlarm" resultType="com.bonus.material.cityScreen.VO.AlarmVO">
|
||||
select
|
||||
|
|
@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
concat('差',TIMESTAMPDIFF(DAY, NOW(),mdi.expiration_time),'天退役') as situation
|
||||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status != 4
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status != 4
|
||||
order by TIMESTAMPDIFF(YEAR, NOW(),mdi.expiration_time)
|
||||
</select>
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
count(DISTINCT mdi.ma_id)
|
||||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status != 4
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status != 4
|
||||
</select>
|
||||
|
||||
<select id="countEquipmentTurnoverRate" resultType="int">
|
||||
|
|
@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
count(1)
|
||||
from ma_dev_info mdi
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status != 3
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status != 3
|
||||
</select>
|
||||
|
||||
<select id="equipmentTurnoverRate" resultType="com.bonus.material.cityScreen.VO.EquipmentTurnoverRateVO">
|
||||
|
|
@ -131,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
left join cs_device_change_details cdcd on cdcd.dev_id = mdi.ma_id
|
||||
left join cs_device_change cdc on cdc.id = cdcd.change_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status != 4 and cdc.type = 2 and cdc.del_flag = 0
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status != 4 and cdc.type = 2 and cdc.del_flag = 0
|
||||
and TIMESTAMPDIFF(MONTH , NOW(),cdc.create_time) between 0 and 12
|
||||
group by mtv.proType, mtv.mainGx, mtv.childGx, mdi.device_name
|
||||
order by turnoverRate desc
|
||||
|
|
@ -145,7 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from jj_sing_project jsp
|
||||
left join ma_dev_info mdi on mdi.on_project = jsp.id
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status in (2,3)
|
||||
where mdi.is_active = 1 and mdi.on_company = #{companyId} and mdi.change_status in (2,3)
|
||||
<if test="voltageLevel != null">
|
||||
and jsp.voltage = #{voltageLevel}
|
||||
</if>
|
||||
|
|
@ -163,7 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_dev_info mdi on mdi.on_project = jsp.id
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1
|
||||
and mdi.own_co = #{companyId}
|
||||
and mdi.on_company = #{companyId}
|
||||
and mdi.change_status in (2, 3)
|
||||
<if test="voltageLevel != null">
|
||||
and jsp.voltage = #{voltageLevel}
|
||||
|
|
@ -184,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_dev_info mdi on mdi.on_project = jsp.id
|
||||
left join ma_type_view mtv on mtv.typeId = mdi.type_id
|
||||
where mdi.is_active = 1
|
||||
and mdi.own_co = #{companyId}
|
||||
and mdi.on_company = #{companyId}
|
||||
and mdi.change_status in (2, 3)
|
||||
<if test="voltageLevel != null">
|
||||
and jsp.voltage = #{voltageLevel}
|
||||
|
|
|
|||
|
|
@ -51,11 +51,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevInfoList" resultType="com.bonus.material.devchange.domain.DevChangeVo">
|
||||
select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand ,
|
||||
mdq.next_check_time nextDate,mt.typeId, mt.unit_name unit,mt.maintenance_alarm_day ,
|
||||
mt.lease_price,mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
|
||||
mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
|
||||
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
|
||||
dev.on_project proId,dev.change_status AS status
|
||||
FROM ma_dev_info dev
|
||||
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||
left join bm_company_info bci on bci.company_id=dev.on_company
|
||||
left join ma_type_view mt on mt.typeId=dev.type_id
|
||||
LEFT JOIN (SELECT max( next_check_time) next_check_time,ma_id from ma_dev_qc GROUP BY ma_id ) mdq on dev.ma_id=mdq.ma_id
|
||||
left join jj_sing_project pro on pro.pro_code=dev.on_project
|
||||
|
|
@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getChangeUnit" resultType="java.lang.String">
|
||||
select bci.company_name compName
|
||||
FROM ma_dev_info dev
|
||||
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||
left join bm_company_info bci on bci.company_id=dev.on_company
|
||||
where is_active=1 and bci.company_name is not null
|
||||
and dev. ma_id=#{devId}
|
||||
</select>
|
||||
|
|
@ -155,12 +155,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getDevDetails" resultType="com.bonus.material.devchange.domain.DevChangeVo">
|
||||
select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand ,
|
||||
mdq.next_check_time nextDate,mt.typeId, mt.unit_name unit,mt.maintenance_alarm_day ,
|
||||
mt.lease_price,mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
|
||||
mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
|
||||
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
|
||||
dev.on_project proId
|
||||
FROM cs_device_change_details dcd
|
||||
left join ma_dev_info dev on dcd.dev_id=dev.ma_id
|
||||
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||
left join bm_company_info bci on bci.company_id=dev.on_company
|
||||
left join ma_type_view mt on mt.typeId=dev.type_id
|
||||
LEFT JOIN
|
||||
(SELECT max( next_check_time) next_check_time,ma_id
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
<resultMap id="BaseResultMap" type="com.bonus.material.devchange.domain.MaDevInfo">
|
||||
<id column="ma_id" property="maId"/>
|
||||
<result column="device_name" property="deviceName"/>
|
||||
<result column="device_weight" property="deviceWeight"/>
|
||||
<result column="device_count" property="deviceCount"/>
|
||||
<result column="code" property="code"/>
|
||||
<result column="identify_code" property="identifyCode"/>
|
||||
|
|
@ -13,18 +12,16 @@
|
|||
<result column="lease_scope" property="leaseScope"/>
|
||||
<result column="location" property="location"/>
|
||||
<result column="brand" property="brand"/>
|
||||
<result column="model_name" property="modelName"/>
|
||||
<result column="production_date" property="productionDate"/>
|
||||
<result column="working_hours" property="workingHours"/>
|
||||
<result column="serial_number" property="serialNumber"/>
|
||||
<result column="month_lease_price" property="monthLeasePrice"/>
|
||||
<result column="day_lease_price" property="dayLeasePrice"/>
|
||||
<result column="pic_url" property="picUrl"/>
|
||||
<result column="js_month_price" property="jsMonthPrice"/>
|
||||
<result column="js_day_price" property="jsDayPrice"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="gps_code" property="gpsCode"/>
|
||||
<result column="own_co" property="ownCo"/>
|
||||
<result column="on_company" property="ownCo"/>
|
||||
<result column="person" property="person"/>
|
||||
<result column="person_phone" property="personPhone"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
|
|
@ -71,10 +68,10 @@
|
|||
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
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,
|
||||
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,
|
||||
ma_id, device_name, device_count, code, identify_code, type_id, ma_status,
|
||||
lease_scope, `location`, brand, production_date, working_hours, serial_number,
|
||||
month_lease_price, day_lease_price, js_month_price, js_day_price, description,
|
||||
gps_code, on_company, person, person_phone, create_time, creator, deposit, is_active,
|
||||
update_time, update_by, is_operator, specification, province_id, city_id, area_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,
|
||||
|
|
@ -110,7 +107,6 @@
|
|||
mtv.unit_name,
|
||||
mdi.ma_id,
|
||||
mdi.device_name,
|
||||
mdi.model_name,
|
||||
mdi.ma_status,
|
||||
mdi.`code`,
|
||||
mdi.expiration_time,
|
||||
|
|
@ -125,12 +121,11 @@
|
|||
mdi.change_status,
|
||||
mdi.up_down_status,
|
||||
mdq.next_check_time,
|
||||
mdi.brand,
|
||||
mdi.pic_url
|
||||
mdi.brand
|
||||
FROM
|
||||
ma_dev_info mdi
|
||||
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.on_company
|
||||
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 jj_sing_project jsp ON jsp.pro_code = mdi.on_project
|
||||
|
|
@ -196,10 +191,6 @@
|
|||
<if test="deviceName != null and deviceName != ''">
|
||||
device_name = #{deviceName},
|
||||
</if>
|
||||
|
||||
<if test="deviceWeight != null">
|
||||
device_weight = #{deviceWeight},
|
||||
</if>
|
||||
<if test="deviceCount != null">
|
||||
device_count = #{deviceCount},
|
||||
</if>
|
||||
|
|
@ -226,9 +217,6 @@
|
|||
<if test="brand != null and brand != ''">
|
||||
brand = #{brand},
|
||||
</if>
|
||||
<if test="modelName != null and modelName != ''">
|
||||
model_name = #{modelName},
|
||||
</if>
|
||||
<if test="productionDate != null">
|
||||
production_date = #{productionDate},
|
||||
</if>
|
||||
|
|
@ -277,9 +265,6 @@
|
|||
</if>
|
||||
|
||||
<!-- 其他信息字段 -->
|
||||
<if test="picUrl != null and picUrl != ''">
|
||||
pic_url = #{picUrl},
|
||||
</if>
|
||||
<if test="videoUrl != null and videoUrl != ''">
|
||||
video_url = #{videoUrl},
|
||||
</if>
|
||||
|
|
@ -336,7 +321,7 @@
|
|||
FROM
|
||||
ma_dev_info mdi
|
||||
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.on_company
|
||||
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
|
||||
WHERE mdi.is_active = 1
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
<result column="device_status" property="deviceStatus"/>
|
||||
<result column="expiration_time" property="expirationTime"/>
|
||||
<result column="ma_id" property="maId"/>
|
||||
<result column="model_name" property="modelName"/>
|
||||
<result column="production_date" property="productionDate"/>
|
||||
<result column="remaining_days" property="remainingDays"/>
|
||||
<result column="remaining_years" property="remainingYears"/>
|
||||
|
|
@ -25,7 +24,6 @@
|
|||
c.company_name,
|
||||
mdi.ma_id,
|
||||
mdi.device_name,
|
||||
mdi.model_name,
|
||||
mdi.`code`,
|
||||
mdi.brand,
|
||||
mdi.production_date,
|
||||
|
|
@ -57,7 +55,7 @@
|
|||
END AS device_status
|
||||
FROM
|
||||
ma_dev_info mdi
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
WHERE mdi.is_active = 1 and mdi.entry_status = '1' and mdi.change_status in (1,5)
|
||||
<if test="deviceName != null and deviceName != ''">
|
||||
|
|
|
|||
|
|
@ -17,17 +17,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="cityId" column="city_id" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="brand" column="brand" />
|
||||
<result property="modelName" column="model_name" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="workingHours" column="working_hours" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="dayLeasePrice" column="day_lease_price" />
|
||||
<result property="picUrl" column="pic_url" />
|
||||
<result property="jsMonthPrice" column="js_month_price" />
|
||||
<result property="jsDayPrice" column="js_day_price" />
|
||||
<result property="description" column="description" />
|
||||
<result property="gpsCode" column="gps_code" />
|
||||
<result property="ownCo" column="own_co" />
|
||||
<result property="ownCo" column="on_company" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="creator" column="creator" />
|
||||
<result property="person" column="person" />
|
||||
|
|
@ -44,9 +41,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectDevInfoVo">
|
||||
select ma_id, device_name, device_weight, device_count, code, identify_code, type_id, ma_status, lease_scope, location, province_id, city_id, area_id, brand, model_name, production_date, working_hours, serial_number,
|
||||
pic_url, js_month_price, js_day_price, description, gps_code, own_co, create_time,
|
||||
creator, update_time, person, person_phone, update_by, specification, deposit, is_operator, is_active, update_time, update_by
|
||||
select ma_id, device_name, device_count, code, identify_code, type_id, ma_status, location,
|
||||
province_id, city_id, area_id, brand, production_date, max_working_hours,
|
||||
on_company, create_time,
|
||||
creator, update_time, person, person_phone, update_by, is_active, update_time, update_by
|
||||
from ma_dev_info
|
||||
</sql>
|
||||
|
||||
|
|
@ -63,25 +61,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.code as `code`,
|
||||
d.identify_code as identifyCode,
|
||||
d.device_name as deviceName,
|
||||
d.device_weight as deviceWeight,
|
||||
d.device_count as deviceCount,
|
||||
d.type_id as typeId,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
d.create_time as createTime,
|
||||
d.update_time as updateTime,
|
||||
d.own_co as companyId,
|
||||
d.on_company as companyId,
|
||||
sd.dept_name as companyName,
|
||||
c.operate_address as operateAddress
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type_view mtv ON mtv.typeId = d.type_id
|
||||
<where>
|
||||
|
|
@ -97,7 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cityId != null and cityId != ''"> and d.city_id = #{cityId}</if>
|
||||
<if test="areaId != null and areaId != ''"> and d.area_id = #{areaId}</if>
|
||||
<if test="brand != null and brand != ''"> and d.brand = #{brand}</if>
|
||||
<if test="modelName != null and modelName != ''"> and d.model_name like concat('%', #{modelName}, '%')</if>
|
||||
<if test="ageMin != null and ageMax != null">
|
||||
and TIMESTAMPDIFF(YEAR, d.production_date, NOW()) >= #{ageMin}
|
||||
and TIMESTAMPDIFF(YEAR, d.production_date, NOW()) <= #{ageMax}
|
||||
|
|
@ -108,10 +102,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="workingHoursMin != null and workingHoursMin != '' and workingHoursMax != null and workingHoursMax != ''">
|
||||
and d.working_hours >= #{workingHoursMin} and d.working_hours <= #{workingHoursMax}
|
||||
</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and d.serial_number = #{serialNumber}</if>
|
||||
<if test="description != null and description != ''"> and d.description = #{description}</if>
|
||||
<if test="gpsCode != null and gpsCode != ''"> and d.gps_code = #{gpsCode}</if>
|
||||
<if test="companyId != null and companyId != ''"> and d.own_co = #{companyId}</if>
|
||||
<if test="companyId != null and companyId != ''"> and d.on_company = #{companyId}</if>
|
||||
<if test="specification != null "> and d.specification = #{specification}</if>
|
||||
<if test="deposit != null "> and d.deposit = #{deposit}</if>
|
||||
<if test="startTime != null and endTime != null">
|
||||
|
|
@ -156,19 +149,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.identify_code as identifyCode,
|
||||
d.device_name as deviceName,
|
||||
d.device_count as deviceCount,
|
||||
d.device_weight as deviceWeight,
|
||||
d.type_id as typeId,
|
||||
mt4.type_name as typeName,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
mt4.lease_price as dayLeasePrice,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
d.own_co as companyId,
|
||||
d.on_company as companyId,
|
||||
sd.dept_name as companyName,
|
||||
c.operate_address as operateAddress,
|
||||
d.create_time as createTime,
|
||||
|
|
@ -180,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.type_name as firstName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id and mt4.del_flag = '0'
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt4.parent_id and mt3.del_flag = '0'
|
||||
|
|
@ -204,7 +193,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.item_type_model as itemTypeModel,
|
||||
identify_code as identifyCode,
|
||||
d.device_name as deviceName,
|
||||
d.device_weight as deviceWeight,
|
||||
d.device_count as deviceCount,
|
||||
d.type_id as typeId,
|
||||
d.check_date as checkDate,
|
||||
|
|
@ -223,15 +211,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt4.maintenance_alarm_day,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
mt4.lease_price as dayLeasePrice,
|
||||
d.max_working_hours as workingHours,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
d.own_id as ownId,
|
||||
d.own_co as companyId,
|
||||
d.on_company as companyId,
|
||||
sd.dept_name as companyName,
|
||||
c.operate_address as operateAddress,
|
||||
mt3.type_id as thirdId,
|
||||
|
|
@ -244,13 +228,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(h.search_num, 0) as searchNum,
|
||||
d.create_time as createTime,
|
||||
d.update_time as updateTime,
|
||||
d.is_zone as isZone,
|
||||
d.zone_id as zoneId,
|
||||
d.expiration_time,
|
||||
d.entry_status
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_hot_search h ON d.ma_id = h.ma_id
|
||||
LEFT JOIN ma_type_view mtv ON mtv.typeId = d.type_id
|
||||
|
|
@ -273,7 +255,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into ma_dev_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != '' ">device_name,</if>
|
||||
<if test="deviceWeight != null and deviceWeight != '' ">device_weight,</if>
|
||||
<if test="deviceType != null">device_type,</if>
|
||||
<if test="deviceCount != null">device_count,</if>
|
||||
<if test="code != null and code != '' ">code,</if>
|
||||
|
|
@ -286,16 +267,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cityId != null and cityId != ''">city_id,</if>
|
||||
<if test="areaId != null and areaId != ''">area_id,</if>
|
||||
<if test="brand != null and brand != ''">brand,</if>
|
||||
<if test="modelName != null and modelName != ''">model_name,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="workingHours != null and workingHours != ''">working_hours,</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
||||
<if test="picUrl != null and picUrl != ''">pic_url,</if>
|
||||
<if test="jsMonthPrice != null and jsMonthPrice != ''">js_month_price,</if>
|
||||
<if test="jsDayPrice != null and jsDayPrice != ''">js_day_price,</if>
|
||||
<if test="description != null and description != ''">`description`,</if>
|
||||
<if test="gpsCode != null and gpsCode != ''">gps_code,</if>
|
||||
<if test="companyId != null and companyId != ''" >own_co,</if>
|
||||
<if test="companyId != null and companyId != ''" >on_company,</if>
|
||||
<if test="person != null and person != ''">person,</if>
|
||||
<if test="personPhone != null and personPhone != ''">person_phone,</if>
|
||||
create_time,
|
||||
|
|
@ -307,14 +285,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isOperator != null and isOperator != ''">is_operator,</if>
|
||||
<if test="isActive != null and isActive != ''">is_active,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="ownId != null">own_id,</if>
|
||||
<if test="checkDate != null">check_date,</if>
|
||||
<if test="checkCycle != null">check_cycle,</if>
|
||||
<if test="isZone != null">is_zone,</if>
|
||||
<if test="zoneId != null">zone_id,</if>
|
||||
<if test="buyPrice != null">buy_price,</if>
|
||||
<if test="itemTypeModel != null">item_type_model,</if>
|
||||
|
||||
<if test="changeStatus != null">change_status,</if>
|
||||
<if test="expirationTime != null">expiration_time,</if>
|
||||
<if test="entryStatus != null">entry_status,</if>
|
||||
|
|
@ -322,7 +296,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
<if test="deviceWeight != null and deviceWeight != ''">#{deviceWeight},</if>
|
||||
<if test="deviceType != null">#{deviceType},</if>
|
||||
<if test="deviceCount != null">#{deviceCount},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
|
|
@ -391,7 +364,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="code != null and code != '' ">code = #{code},</if>
|
||||
<if test="identifyCode != null and identifyCode != '' ">identify_code = #{identifyCode},</if>
|
||||
<if test="deviceName != null and deviceName != '' ">device_name = #{deviceName},</if>
|
||||
<if test="deviceWeight != null">device_weight = #{deviceWeight},</if>
|
||||
<if test="deviceCount != null">device_count = #{deviceCount},</if>
|
||||
<if test="typeId != null">type_id = #{typeId},</if>
|
||||
<if test="maStatus != null">ma_status = #{maStatus},</if>
|
||||
|
|
@ -401,16 +373,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cityId != null">city_id = #{cityId},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="brand != null">brand = #{brand},</if>
|
||||
<if test="modelName != null">model_name = #{modelName},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="workingHours != null">working_hours = #{workingHours},</if>
|
||||
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||||
<if test="picUrl != null">pic_url = #{picUrl},</if>
|
||||
<if test="jsMonthPrice != null">js_month_price = #{jsMonthPrice},</if>
|
||||
<if test="jsDayPrice != null">js_day_price = #{jsDayPrice},</if>
|
||||
<if test="description != null">`description` = #{description},</if>
|
||||
<if test="gpsCode != null">gps_code = #{gpsCode},</if>
|
||||
<if test="companyId != null">own_co = #{companyId},</if>
|
||||
<if test="companyId != null">on_company = #{companyId},</if>
|
||||
<if test="person != null">person = #{person},</if>
|
||||
<if test="personPhone != null">person_phone = #{personPhone},</if>
|
||||
<if test="specification != null">specification = #{specification},</if>
|
||||
|
|
@ -543,8 +512,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="leaseScope != null "> and d.lease_scope = #{leaseScope}</if>
|
||||
<if test="areaId != null and areaId != ''"> and d.area_id = #{areaId}</if>
|
||||
<if test="brand != null and brand != ''"> and d.brand = #{brand}</if>
|
||||
<if test="modelName != null and modelName != ''"> and d.model_name like concat('%', #{modelName}, '%')</if>
|
||||
<if test="companyId != null and companyId !=''"> and d.own_co = #{companyId}</if>
|
||||
<if test="companyId != null and companyId !=''"> and d.on_company = #{companyId}</if>
|
||||
<if test="startTime != null and endTime !='' and endTime != null and endTime !=''">
|
||||
and d.update_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
|
|
@ -552,13 +520,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and (
|
||||
locate(#{keyWord},c.company_name) > 0
|
||||
or locate(#{keyWord},d.ma_id) > 0
|
||||
or locate(#{keyWord},d.model_name) > 0
|
||||
or locate(#{keyWord},d.specification) > 0
|
||||
or locate(#{keyWord},d.serial_number) > 0
|
||||
or locate(#{keyWord},d.description) > 0
|
||||
)
|
||||
</if>
|
||||
and d.own_co = #{companyId}
|
||||
and d.on_company = #{companyId}
|
||||
and d.is_active = '1'
|
||||
</where>
|
||||
ORDER BY d.create_time desc
|
||||
|
|
@ -615,9 +581,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getMaCountByCompany" resultType="com.bonus.common.biz.domain.BmCompanyInfo">
|
||||
select own_co as companyId,count(1) as maCount from ma_dev_info
|
||||
select on_company as companyId,count(1) as maCount from ma_dev_info
|
||||
where ma_status=2
|
||||
group by own_co
|
||||
group by on_company
|
||||
</select>
|
||||
|
||||
<select id="getBookCar" resultType="com.bonus.material.book.domain.BookCarInfoDto">
|
||||
|
|
@ -637,7 +603,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into ma_dev_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != '' ">device_name,</if>
|
||||
<if test="deviceWeight != null and deviceWeight != '' ">device_weight,</if>
|
||||
<if test="deviceCount != null">device_count,</if>
|
||||
<if test="code != null and code != '' ">code,</if>
|
||||
<if test="identifyCode != null and identifyCode != '' ">identify_code,</if>
|
||||
|
|
@ -649,16 +614,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cityId != null and cityId != ''">city_id,</if>
|
||||
<if test="areaId != null and areaId != ''">area_id,</if>
|
||||
<if test="brand != null and brand != ''">brand,</if>
|
||||
<if test="modelName != null and modelName != ''">model_name,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="workingHours != null and workingHours != ''">working_hours,</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
||||
<if test="picUrl != null and picUrl != ''">pic_url,</if>
|
||||
<if test="jsMonthPrice != null and jsMonthPrice != ''">js_month_price,</if>
|
||||
<if test="jsDayPrice != null and jsDayPrice != ''">js_day_price,</if>
|
||||
<if test="description != null and description != ''">`description`,</if>
|
||||
<if test="gpsCode != null and gpsCode != ''">gps_code,</if>
|
||||
<if test="companyId != null and companyId != ''" >own_co,</if>
|
||||
<if test="companyId != null and companyId != ''" >on_company,</if>
|
||||
<if test="person != null and person != ''">person,</if>
|
||||
<if test="personPhone != null and personPhone != ''">person_phone,</if>
|
||||
create_time,
|
||||
|
|
@ -670,7 +632,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isOperator != null and isOperator != ''">is_operator,</if>
|
||||
is_active,
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="ownId != null and ownId != ''">own_id,</if>
|
||||
<if test="checkDate != null">check_date,</if>
|
||||
<if test="checkCycle != null">check_cycle,</if>
|
||||
</trim>
|
||||
|
|
@ -725,7 +686,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectCompany" resultType="java.lang.Integer">
|
||||
select COUNT(1) from ma_dev_info where ma_status = '2' and own_co = #{companyId}
|
||||
select COUNT(1) from ma_dev_info where ma_status = '2' and on_company = #{companyId}
|
||||
</select>
|
||||
|
||||
<select id="getLeaseList" resultType="com.bonus.material.device.domain.vo.LeaseVo">
|
||||
|
|
@ -754,7 +715,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND m.is_active = '1'
|
||||
WHERE
|
||||
m.ma_status = '2'
|
||||
AND m.own_co = #{companyId}
|
||||
AND m.on_company = #{companyId}
|
||||
</select>
|
||||
|
||||
<select id="selectTaskNumByMonth" resultType="java.lang.String">
|
||||
|
|
@ -796,7 +757,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where
|
||||
d.ma_status != 0
|
||||
and d.is_active = '1'
|
||||
and d.own_co = #{companyId}
|
||||
and d.on_company = #{companyId}
|
||||
ORDER BY d.create_time desc
|
||||
</select>
|
||||
<select id="getTagDevList" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
|
|
@ -806,12 +767,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dept.dept_name as comName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_user u ON d.own_id = u.user_id
|
||||
LEFT JOIN sys_dept dept ON d.own_co = dept.dept_id
|
||||
LEFT JOIN sys_user u ON d.creator = u.user_id
|
||||
LEFT JOIN sys_dept dept ON d.on_company = dept.dept_id
|
||||
WHERE
|
||||
d.is_active = 1
|
||||
AND d.ma_status !=0
|
||||
AND d.own_co = #{ownCo}
|
||||
AND d.on_company = #{ownCo}
|
||||
<if test="code != null and code != ''">
|
||||
and d.code like concat('%',#{code},'%')
|
||||
</if>
|
||||
|
|
@ -834,23 +795,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.CODE AS code,
|
||||
d.identify_code AS identifyCode,
|
||||
d.device_name AS deviceName,
|
||||
d.device_weight AS deviceWeight,
|
||||
d.device_count AS deviceCount,
|
||||
d.type_id AS typeId,
|
||||
mt4.type_name AS typeName,
|
||||
mt4.unit_name AS unitName,
|
||||
d.ma_status AS maStatus,
|
||||
d.brand AS brand,
|
||||
d.model_name AS modelName,
|
||||
d.production_date AS productionDate,
|
||||
d.working_hours AS workingHours,
|
||||
d.serial_number AS serialNumber,
|
||||
mt4.lease_price AS dayLeasePrice,
|
||||
d.person AS person,
|
||||
d.person_phone AS personPhone,
|
||||
d.create_time AS createTime,
|
||||
d.update_time AS updateTime,
|
||||
d.own_co AS companyId,
|
||||
d.on_company AS companyId,
|
||||
sd.dept_name AS companyName,
|
||||
c.operate_address AS operateAddress,
|
||||
mt3.type_id AS thirdId,
|
||||
|
|
@ -861,7 +818,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.type_name AS firstName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id
|
||||
AND mt4.del_flag = '0'
|
||||
|
|
@ -1017,10 +974,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update ma_dev_info set total_lease_day = IFNULL(total_lease_day, 0) + 1
|
||||
where is_active = '1' and ma_status = '3'
|
||||
</update>
|
||||
<update id="updateTypeLeasePrice">
|
||||
update ma_type set lease_price = #{dayLeasePrice}
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<select id="getIdleDevRatio" resultType="com.bonus.material.device.domain.DevInfo">
|
||||
SELECT
|
||||
|
|
@ -1055,9 +1008,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select
|
||||
sd.dept_name as com_name,count(mdi.ma_id) as device_count
|
||||
from ma_dev_info mdi
|
||||
LEFT JOIN sys_dept sd on sd.dept_id=mdi.own_co
|
||||
LEFT JOIN sys_dept sd on sd.dept_id=mdi.on_company
|
||||
where mdi.ma_status in (2,3)
|
||||
group by mdi.own_co
|
||||
group by mdi.on_company
|
||||
order by device_count desc
|
||||
</select>
|
||||
|
||||
|
|
@ -1067,23 +1020,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.CODE AS code,
|
||||
d.identify_code AS identifyCode,
|
||||
d.device_name AS deviceName,
|
||||
d.device_weight AS deviceWeight,
|
||||
d.device_count AS deviceCount,
|
||||
d.type_id AS typeId,
|
||||
mt4.type_name AS typeName,
|
||||
mt4.unit_name AS unitName,
|
||||
d.ma_status AS maStatus,
|
||||
d.brand AS brand,
|
||||
d.model_name AS modelName,
|
||||
d.production_date AS productionDate,
|
||||
d.working_hours AS workingHours,
|
||||
d.serial_number AS serialNumber,
|
||||
mt4.lease_price AS dayLeasePrice,
|
||||
d.person AS person,
|
||||
d.person_phone AS personPhone,
|
||||
d.create_time AS createTime,
|
||||
d.update_time AS updateTime,
|
||||
d.own_co AS companyId,
|
||||
d.on_company AS companyId,
|
||||
sd.dept_name AS companyName,
|
||||
c.operate_address AS operateAddress,
|
||||
mt3.type_id AS thirdId,
|
||||
|
|
@ -1094,7 +1043,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.type_name AS firstName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id
|
||||
AND mt4.del_flag = '0'
|
||||
|
|
@ -1136,19 +1085,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.identify_code as identifyCode,
|
||||
d.device_name as deviceName,
|
||||
d.device_count as deviceCount,
|
||||
d.device_weight as deviceWeight,
|
||||
d.type_id as typeId,
|
||||
mt4.type_name as typeName,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
mt4.lease_price as dayLeasePrice,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
d.own_co as companyId,
|
||||
d.on_company as companyId,
|
||||
d.total_lease_day as totalLeaseDay,
|
||||
d.total_up_day as totalUpDay,
|
||||
sd.dept_name as companyName,
|
||||
|
|
@ -1162,7 +1107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.type_name as firstName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id and mt4.del_flag = '0'
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt4.parent_id and mt3.del_flag = '0'
|
||||
|
|
@ -1180,14 +1125,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
md.ma_id AS maId,
|
||||
COUNT( md.order_id ) AS orderNum ,
|
||||
mdi.own_co AS companyId,
|
||||
mdi.on_company AS companyId,
|
||||
md.order_id AS orderId,
|
||||
sd.dept_name AS companyName
|
||||
FROM
|
||||
ma_order_details md
|
||||
LEFT JOIN ma_dev_info mdi on md.ma_id = mdi.ma_id
|
||||
LEFT JOIN sys_dept sd on mdi.own_co = sd.dept_id
|
||||
WHERE md.order_status != 0 and md.order_status != 99 and mdi.own_co =#{companyId}
|
||||
LEFT JOIN sys_dept sd on mdi.on_company = sd.dept_id
|
||||
WHERE md.order_status != 0 and md.order_status != 99 and mdi.on_company =#{companyId}
|
||||
GROUP BY
|
||||
md.order_id
|
||||
|
||||
|
|
@ -1211,12 +1156,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.dept_id = #{companyId}
|
||||
AND d.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectDevTypeByName" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
SELECT
|
||||
type_id as typeId,
|
||||
type_name as typeName,
|
||||
manage_type as manageType,
|
||||
lease_price as dayLeasePrice,
|
||||
unit_name as unitName
|
||||
FROM
|
||||
ma_type
|
||||
|
|
@ -1225,6 +1170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND `level` = '4'
|
||||
AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="getDevNumList" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
SELECT
|
||||
mt.type_name as modelName , mdi.device_name as deviceName ,mt2.type_name as typeName,mdi.identify_code as identifyCode,
|
||||
|
|
@ -1233,7 +1179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_dev_info mdi
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN sys_dept sd ON mdi.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON mdi.on_company = sd.dept_id
|
||||
WHERE
|
||||
is_active = '1'
|
||||
AND ma_status != 0
|
||||
|
|
@ -1253,7 +1199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_dev_info mdi
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN sys_dept sd ON mdi.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON mdi.on_company = sd.dept_id
|
||||
WHERE
|
||||
is_active = '1'
|
||||
AND ma_status = '2'
|
||||
|
|
@ -1306,7 +1252,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
SELECT
|
||||
mdi.device_name as deviceName,mt.type_name as modelName,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
count(mrd.ma_id) as rentNum
|
||||
FROM
|
||||
ma_order_details mrd
|
||||
|
|
@ -1334,7 +1279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_dev_info mdi
|
||||
LEFT JOIN ma_order_details md on mdi.ma_id = md.ma_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN sys_dept sd on sd.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept sd on sd.dept_id = mdi.on_company
|
||||
LEFT JOIN ma_order_info moi on moi.order_id = md.order_id
|
||||
LEFT JOIN sys_dept sd2 on moi.buyer_company = sd2.dept_id
|
||||
LEFT JOIN sys_user su on moi.buyer_id = su.user_id
|
||||
|
|
@ -1365,11 +1310,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM
|
||||
ma_order_details hh
|
||||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN sys_dept sd ON mdi.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON mdi.on_company = sd.dept_id
|
||||
WHERE
|
||||
hh.order_status NOT IN ( 0, 99 )
|
||||
GROUP BY
|
||||
mdi.own_co
|
||||
mdi.on_company
|
||||
</select>
|
||||
<select id="getMaTypeLeasingDetail" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
SELECT
|
||||
|
|
@ -1388,7 +1333,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_order_details md
|
||||
LEFT JOIN ma_dev_info mdi ON mdi.ma_id = md.ma_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN ma_order_info moi ON moi.order_id = md.order_id
|
||||
LEFT JOIN sys_dept sd2 ON moi.buyer_company = sd2.dept_id
|
||||
LEFT JOIN sys_user su ON moi.buyer_id = su.user_id
|
||||
|
|
@ -1406,7 +1351,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getTotalEquipment" resultType="java.lang.Integer">
|
||||
select count(1) from ma_dev_info where is_active ='1'
|
||||
<if test="ownCo != null ">
|
||||
AND own_co = #{ownCo}
|
||||
AND on_company = #{ownCo}
|
||||
</if>
|
||||
<if test="changeStatus != null ">
|
||||
AND change_status = #{changeStatus}
|
||||
|
|
@ -1415,7 +1360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getTotalValue" resultType="java.math.BigDecimal">
|
||||
select SUM(buy_price) from ma_dev_info where is_active ='1'
|
||||
<if test="ownCo != null ">
|
||||
AND own_co = #{ownCo}
|
||||
AND on_company = #{ownCo}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLineNum" resultType="java.lang.Integer">
|
||||
|
|
@ -1467,7 +1412,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where mt6.type_id = #{id} and mdi.is_active ='1'
|
||||
</select>
|
||||
<select id="getPrice" resultType="java.math.BigDecimal">
|
||||
select SUM(buy_price) from ma_dev_info where is_active ='1' and own_co = #{deptId}
|
||||
select SUM(buy_price) from ma_dev_info where is_active ='1' and on_company = #{deptId}
|
||||
</select>
|
||||
<select id="getEquipmentStatus" resultType="java.lang.Integer">
|
||||
select count(1) from ma_dev_info where is_active ='1' and change_status = #{changeStatus}
|
||||
|
|
@ -1491,25 +1436,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.code as code,
|
||||
d.identify_code as identifyCode,
|
||||
d.device_name as deviceName,
|
||||
d.device_weight as deviceWeight,
|
||||
d.device_count as deviceCount,
|
||||
d.type_id as typeId,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
d.create_time as createTime,
|
||||
d.update_time as updateTime,
|
||||
d.own_co as companyId,
|
||||
d.on_company as companyId,
|
||||
sd.dept_name as companyName,
|
||||
c.operate_address as operateAddress
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type_view mtv ON mtv.typeId = d.type_id
|
||||
<where>
|
||||
|
|
@ -1525,7 +1467,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cityId != null and cityId != ''"> and d.city_id = #{cityId}</if>
|
||||
<if test="areaId != null and areaId != ''"> and d.area_id = #{areaId}</if>
|
||||
<if test="brand != null and brand != ''"> and d.brand = #{brand}</if>
|
||||
<if test="modelName != null and modelName != ''"> and d.model_name like concat('%', #{modelName}, '%')</if>
|
||||
<if test="ageMin != null and ageMax != null">
|
||||
and TIMESTAMPDIFF(YEAR, d.production_date, NOW()) >= #{ageMin}
|
||||
and TIMESTAMPDIFF(YEAR, d.production_date, NOW()) <= #{ageMax}
|
||||
|
|
@ -1536,10 +1477,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="workingHoursMin != null and workingHoursMin != '' and workingHoursMax != null and workingHoursMax != ''">
|
||||
and d.working_hours >= #{workingHoursMin} and d.working_hours <= #{workingHoursMax}
|
||||
</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and d.serial_number = #{serialNumber}</if>
|
||||
<if test="description != null and description != ''"> and d.description = #{description}</if>
|
||||
<if test="gpsCode != null and gpsCode != ''"> and d.gps_code = #{gpsCode}</if>
|
||||
<if test="companyId != null and companyId != ''"> and d.own_co = #{companyId}</if>
|
||||
<if test="companyId != null and companyId != ''"> and d.on_company = #{companyId}</if>
|
||||
<if test="specification != null "> and d.specification = #{specification}</if>
|
||||
<if test="deposit != null "> and d.deposit = #{deposit}</if>
|
||||
<if test="startTime != null and endTime != null">
|
||||
|
|
|
|||
|
|
@ -47,15 +47,13 @@
|
|||
d.device_name as deviceName,
|
||||
d.device_count as deviceCount,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
d.create_time as createTime,
|
||||
d.update_time as updateTime,
|
||||
d.own_co as companyId,
|
||||
d.on_company as companyId,
|
||||
sd.dept_name as companyName,
|
||||
c.operate_address as operateAddress,
|
||||
d.entry_status AS entryStatus,
|
||||
|
|
@ -63,7 +61,7 @@
|
|||
FROM cs_device_real_dev cdrd
|
||||
LEFT JOIN ma_dev_info d ON cdrd.dev_id = d.ma_id AND d.is_active = '1'
|
||||
LEFT JOIN cs_device_status cds ON cdrd.cs_id = cds.id
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type_view mtv ON mtv.typeId = d.type_id
|
||||
<where>
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
|
||||
</if>
|
||||
<if test="qcCom != null and qcCom != ''">
|
||||
and m2.own_co = #{qcCom}
|
||||
and m2.on_company = #{qcCom}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY m2.ma_id
|
||||
|
|
@ -162,7 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mdc.qc_com,
|
||||
mdc.ma_id,
|
||||
mdi.device_name,
|
||||
mdi.own_id,
|
||||
mdi.creator as own_id,
|
||||
sd.dept_name as comName,
|
||||
mdc.next_check_time
|
||||
FROM
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
aa.create_time AS createTime
|
||||
FROM
|
||||
ma_dev_info m2
|
||||
LEFT JOIN ma_dev_rm m1 ON m1.ma_id = m2.ma_id AND m1.rm_com = m2.own_co
|
||||
LEFT JOIN ma_dev_rm m1 ON m1.ma_id = m2.ma_id AND m1.rm_com = m2.on_company
|
||||
LEFT JOIN sys_user su ON su.user_id = m1.create_by
|
||||
LEFT JOIN ( SELECT count(*) AS num, ma_id, MAX( rm_time ) AS max_rm_time FROM ma_dev_rm GROUP BY ma_id ) latest_rm ON m1.ma_id = latest_rm.ma_id
|
||||
LEFT JOIN ( SELECT ma_id, min( create_time ) AS create_time FROM ma_dev_rm GROUP BY ma_id ) aa ON m1.ma_id = aa.ma_id
|
||||
|
|
@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
|
||||
</if>
|
||||
<if test="rmCom != null and rmCom != ''">
|
||||
AND m2.own_co = #{rmCom}
|
||||
AND m2.on_company = #{rmCom}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY m2.ma_id
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
LEFT JOIN sys_user su ON d.own_id = su.user_id
|
||||
LEFT JOIN safe_book sb ON d.ma_id = sb.ma_id
|
||||
WHERE
|
||||
d.own_co = #{uploadCom}
|
||||
d.on_company = #{uploadCom}
|
||||
and d.ma_status != 0
|
||||
AND d.is_active = '1'
|
||||
<if test="code != null and code != ''">
|
||||
|
|
|
|||
|
|
@ -15,27 +15,23 @@
|
|||
SELECT
|
||||
d.ma_id AS maId,
|
||||
d.CODE AS code,
|
||||
d.own_co,
|
||||
d.on_company,
|
||||
CONCAT_WS( '>', mt1.type_name, mt2.type_name, mt3.type_name ) AS deviceTypeName ,
|
||||
d.identify_code AS identifyCode,
|
||||
d.device_name AS deviceName,
|
||||
d.device_weight AS deviceWeight,
|
||||
d.device_count AS deviceCount,
|
||||
d.type_id AS typeId,
|
||||
mt4.type_name AS typeName,
|
||||
mt4.unit_name AS unitName,
|
||||
d.ma_status AS maStatus,
|
||||
d.brand AS brand,
|
||||
d.model_name AS modelName,
|
||||
d.production_date AS productionDate,
|
||||
d.working_hours AS workingHours,
|
||||
d.serial_number AS serialNumber,
|
||||
mt4.lease_price AS dayLeasePrice,
|
||||
d.person AS person,
|
||||
d.person_phone AS personPhone,
|
||||
d.create_time AS createTime,
|
||||
d.update_time AS updateTime,
|
||||
d.own_co AS companyId,
|
||||
d.on_company AS companyId,
|
||||
sd.dept_name AS companyName,
|
||||
c.operate_address AS operateAddress,
|
||||
mt3.type_id AS thirdId,
|
||||
|
|
@ -46,7 +42,7 @@
|
|||
mt1.type_name AS firstName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id
|
||||
AND mt4.del_flag = '0'
|
||||
|
|
@ -57,7 +53,7 @@
|
|||
LEFT JOIN ma_type mt1 ON mt1.type_id = mt2.parent_id
|
||||
AND mt1.del_flag = '0'
|
||||
WHERE
|
||||
d.is_active = '1' and mt3.type_id=#{deviceId} AND d.own_co=#{companyName}
|
||||
d.is_active = '1' and mt3.type_id=#{deviceId} AND d.on_company=#{companyName}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrUpdateBatch" parameterType="com.bonus.material.equipment.domain.DeptEquipmentConfig">
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@
|
|||
|
||||
<select id="listFromDevInfo" resultType="com.bonus.material.equipment.domain.NewmydevInfo">
|
||||
SELECT
|
||||
md.own_co AS companyId,
|
||||
md.on_company AS companyId,
|
||||
mt2.type_id AS typeId, mt2.type_name as typeName,
|
||||
SUM( 1 ) AS ownCount
|
||||
FROM
|
||||
|
|
@ -263,7 +263,7 @@
|
|||
LEFT JOIN ma_type mt ON mt.type_id = md.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
WHERE
|
||||
md.is_active = '1' AND md.own_co = #{companyId}
|
||||
md.is_active = '1' AND md.on_company = #{companyId}
|
||||
GROUP BY
|
||||
mt2.type_id
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -19,21 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where del_flag = '0'
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="getHotSearch" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
SELECT
|
||||
d.ma_id as maId,
|
||||
d.code as code,
|
||||
d.device_name as deviceName,
|
||||
d.device_weight as deviceWeight,
|
||||
d.type_id as typeId,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
c.company_name as companyName,
|
||||
|
|
@ -43,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM
|
||||
ma_hot_search h
|
||||
LEFT JOIN ma_dev_info d on d.ma_id = h.ma_id
|
||||
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||
LEFT JOIN bm_company_info c ON d.on_company = c.company_id
|
||||
LEFT JOIN ma_type mt on mt.type_id = d.type_id
|
||||
where
|
||||
d.is_active='1'
|
||||
|
|
|
|||
|
|
@ -671,14 +671,14 @@
|
|||
</select>
|
||||
|
||||
<select id="getDevNumList" resultType="com.bonus.material.device.domain.DevInfo">
|
||||
SELECT mdi.own_co AS ownCo,
|
||||
SELECT mdi.on_company AS ownCo,
|
||||
sd.dept_name AS comName,
|
||||
count(mdi.device_count) AS deviceCount
|
||||
FROM ma_dev_info mdi
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
WHERE mdi.is_active = '1'
|
||||
AND mdi.ma_status IN (1, 2, 3)
|
||||
GROUP BY mdi.own_co
|
||||
GROUP BY mdi.on_company
|
||||
ORDER BY deviceCount DESC
|
||||
</select>
|
||||
|
||||
|
|
@ -704,10 +704,10 @@
|
|||
LEFT JOIN ma_type mt1 ON mt1.type_id = mt2.parent_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN sys_user su ON mdi.creator = su.user_id
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
WHERE mdi.is_active = '1'
|
||||
AND mdi.ma_status IN (1, 2, 3)
|
||||
AND mdi.own_co = #{ownCo}
|
||||
AND mdi.on_company = #{ownCo}
|
||||
</select>
|
||||
<select id="getAddress" resultType="java.util.Map">
|
||||
SELECT code, name
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
moi.code AS code,
|
||||
GROUP_CONCAT(hh.id) AS ids,
|
||||
moi.order_time,
|
||||
mdi.own_co as sellerCompany,
|
||||
mdi.on_company as sellerCompany,
|
||||
up.dept_name AS czcompanyName,
|
||||
mdi.person AS person,
|
||||
mdi.person_phone AS personPhone,
|
||||
|
|
@ -155,9 +155,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = moi.buyer_id
|
||||
LEFT JOIN sys_user su2 ON su2.user_id = mdi.own_id
|
||||
LEFT JOIN sys_user su2 ON su2.user_id = mdi.creator
|
||||
left join sys_dept dept on dept.dept_id = moi.buyer_company
|
||||
left join sys_dept up on up.dept_id = mdi.own_co
|
||||
left join sys_dept up on up.dept_id = mdi.on_company
|
||||
WHERE
|
||||
mt.del_flag = '0'
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
|
|
@ -167,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND moi.buyer_company = #{buyerCompany}
|
||||
</if>
|
||||
<if test="sellerCompany != null">
|
||||
AND mdi.own_co = #{sellerCompany}
|
||||
AND mdi.on_company = #{sellerCompany}
|
||||
</if>
|
||||
<if test="deviceName != null and deviceName != ''">
|
||||
AND mdi.device_name like concat('%',#{deviceName},'%')
|
||||
|
|
@ -189,9 +189,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="companyName != null and companyName != ''">
|
||||
AND dept.dept_name like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="lowerBound != null and lowerBound != '' and upperBound != null and upperBound != ''">
|
||||
AND mt.lease_price BETWEEN #{lowerBound} AND #{upperBound}
|
||||
</if>
|
||||
GROUP BY
|
||||
moi.buyer_company,
|
||||
moi.`code`,
|
||||
|
|
@ -205,7 +202,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mdi.device_name,
|
||||
mdi.code,
|
||||
mdi.identify_code,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
hh.order_status,
|
||||
hh.days,
|
||||
bfi.url,
|
||||
|
|
@ -256,7 +252,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_order_details hh
|
||||
LEFT JOIN ma_order_info moi ON moi.order_id = hh.order_id
|
||||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN bm_company_info c ON mdi.own_co = c.company_id
|
||||
LEFT JOIN bm_company_info c ON mdi.on_company = c.company_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = moi.buyer_id
|
||||
LEFT JOIN (
|
||||
|
|
@ -287,7 +283,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mdi.code as code,
|
||||
mdi.type_id as typeId,
|
||||
mdi.device_name,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
mt.unit_name as unitName,
|
||||
mt.type_name as typeName,
|
||||
hh.order_status,
|
||||
|
|
@ -334,7 +329,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
hh.order_status as orderStatus,
|
||||
moi.`code` as orderCode,
|
||||
mt.manage_type,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
hh.relief_cost as reliefCost,
|
||||
hh.relief_change_cost as reliefChangeCost,
|
||||
CASE
|
||||
|
|
@ -343,7 +337,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
END AS reliefDays,
|
||||
moi.buyer_company as buyerCompany,
|
||||
bdept.dept_name as buyerCompanyName,
|
||||
mdi.own_co as sellerCompany,
|
||||
mdi.on_company as sellerCompany,
|
||||
sdept.dept_name as sellerCompanyName
|
||||
FROM
|
||||
ma_order_details hh
|
||||
|
|
@ -351,7 +345,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN sys_dept bdept on bdept.dept_id = moi.buyer_company
|
||||
LEFT JOIN sys_dept sdept on sdept.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept sdept on sdept.dept_id = mdi.on_company
|
||||
LEFT JOIN sys_user su1 ON moi.buyer_id = su1.user_id AND su1.del_flag != 2
|
||||
WHERE
|
||||
mt.del_flag = 0 and hh.order_id = #{orderId}
|
||||
|
|
@ -373,7 +367,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND moi.buyer_company = #{buyerCompany}
|
||||
</if>
|
||||
<if test="sellerCompany != null">
|
||||
AND mdi.own_co = #{sellerCompany}
|
||||
AND mdi.on_company = #{sellerCompany}
|
||||
</if>
|
||||
GROUP BY order_id
|
||||
) a
|
||||
|
|
@ -402,7 +396,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = moi.buyer_id
|
||||
LEFT JOIN sys_dept dept ON dept.dept_id = moi.buyer_company
|
||||
LEFT JOIN sys_dept up ON up.dept_id = mdi.own_co
|
||||
LEFT JOIN sys_dept up ON up.dept_id = mdi.on_company
|
||||
WHERE
|
||||
mt.del_flag = '0'
|
||||
AND hh.order_id = #{orderId}
|
||||
|
|
@ -450,17 +444,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="getCompanysCost" resultType="com.bonus.material.largeScreen.entity.OrderData">
|
||||
SELECT
|
||||
mdi.own_co,
|
||||
mdi.on_company,
|
||||
sum( hh.costs ) cost,
|
||||
sd.dept_name AS companyName
|
||||
FROM
|
||||
ma_order_details hh
|
||||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN sys_dept sd ON mdi.own_co = sd.dept_id
|
||||
LEFT JOIN sys_dept sd ON mdi.on_company = sd.dept_id
|
||||
WHERE
|
||||
mdi.is_active = 1 and mdi.ma_status != 0
|
||||
GROUP BY
|
||||
mdi.own_co
|
||||
mdi.on_company
|
||||
</select>
|
||||
<select id="getTodayOrderCount" resultType="com.bonus.material.largeScreen.entity.OrderDto">
|
||||
SELECT
|
||||
|
|
@ -506,7 +500,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_order_info moi on moi.order_id=modd.order_id
|
||||
LEFT JOIN ma_dev_info mdi on mdi.ma_id=modd.ma_id
|
||||
LEFT JOIN sys_dept sd1 on sd1.dept_id=moi.buyer_company
|
||||
LEFT JOIN sys_dept sd2 on sd2.dept_id=mdi.own_co
|
||||
LEFT JOIN sys_dept sd2 on sd2.dept_id=mdi.on_company
|
||||
where sd2.dept_name is not null
|
||||
order by moi.buyer_company
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="listGrouped" resultType="com.bonus.material.equipment.domain.NewOwnerdomin">
|
||||
SELECT
|
||||
md.own_co AS companyId,
|
||||
md.on_company AS companyId,
|
||||
sd.dept_name as companyName,
|
||||
mt2.type_name AS maName,
|
||||
mt2.type_id as typeId,
|
||||
|
|
@ -98,12 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM
|
||||
ma_dev_info md
|
||||
LEFT JOIN ma_type mt ON mt.type_id = md.type_id
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = md.own_co
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = md.on_company
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
WHERE
|
||||
md.is_active = '1'
|
||||
GROUP BY
|
||||
md.own_co,
|
||||
md.on_company,
|
||||
mt2.type_id
|
||||
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue