|
|
|
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="isOperator" column="is_operator" />
|
|
|
|
<result property="isOperator" column="is_operator" />
|
|
|
|
<result property="isActive" column="is_active" />
|
|
|
|
<result property="isActive" column="is_active" />
|
|
|
|
<result property="deviceName" column="device_name" />
|
|
|
|
<result property="deviceName" column="device_name" />
|
|
|
|
|
|
|
|
<result property="deviceWeight" column="device_weight" />
|
|
|
|
<result property="groupName" column="group_name" />
|
|
|
|
<result property="groupName" column="group_name" />
|
|
|
|
<result property="companyName" column="company_name" />
|
|
|
|
<result property="companyName" column="company_name" />
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
@ -50,9 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<select id="selectDevInfoList" parameterType="com.bonus.material.device.domain.vo.DevInfoVo" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
|
|
|
<select id="selectDevInfoList" parameterType="com.bonus.material.device.domain.vo.DevInfoVo" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
|
|
|
select d.*,mt1.type_name as device_name, mt2.type_name as group_name, mt3.type_name as type_name,c.company_name
|
|
|
|
select d.*,mt1.type_name as device_name, mt2.type_name as group_name, mt3.type_name as type_name,c.company_name
|
|
|
|
from ma_dev_info d
|
|
|
|
from ma_dev_info d
|
|
|
|
left join ma_type_info mt1 on d.type_id = mt1.type_id
|
|
|
|
left join ma_type mt1 on d.type_id = mt1.type_id
|
|
|
|
left join ma_type_info mt2 on mt1.parent_id = mt2.type_id
|
|
|
|
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
|
|
|
left join ma_type_info mt3 on mt2.parent_id = mt3.type_id
|
|
|
|
left join ma_type mt3 on mt2.parent_id = mt3.type_id
|
|
|
|
left join bm_company_info c on d.own_co = c.company_id
|
|
|
|
left join bm_company_info c on d.own_co = c.company_id
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="maId != null "> and d.ma_id = #{maId}</if>
|
|
|
|
<if test="maId != null "> and d.ma_id = #{maId}</if>
|
|
|
|
@ -145,43 +146,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
d.person as person,
|
|
|
|
d.person as person,
|
|
|
|
d.person_phone as personPhone,
|
|
|
|
d.person_phone as personPhone,
|
|
|
|
c.company_name as companyName,
|
|
|
|
c.company_name as companyName,
|
|
|
|
h.search_num as searchNum,
|
|
|
|
h.search_num as searchNum
|
|
|
|
d.create_time as createTime
|
|
|
|
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
ma_dev_info d
|
|
|
|
ma_hot_search h
|
|
|
|
LEFT JOIN ma_hot_search h ON d.ma_id = h.ma_id
|
|
|
|
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.own_co = c.company_id
|
|
|
|
where
|
|
|
|
where
|
|
|
|
d.is_active='1'
|
|
|
|
d.is_active='1'
|
|
|
|
and d.ma_status = '2'
|
|
|
|
and d.ma_status = '2'
|
|
|
|
order by d.create_time desc
|
|
|
|
<if test="maId != null">
|
|
|
|
|
|
|
|
and d.ma_id = #{maId}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
order by h.search_num desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectDevInfoByMaId" parameterType="Long" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
|
|
|
<select id="selectDevInfoByMaId" parameterType="Long" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
|
|
|
SELECT
|
|
|
|
select d.*,c.company_name,c.create_time as company_create_time,c.logo_url as company_logo_url,
|
|
|
|
d.ma_id as maId,
|
|
|
|
c.auth_phone, mt1.type_name as device_name,
|
|
|
|
d.code as code,
|
|
|
|
mt2.type_name as group_name, mt3.type_name as type_name,
|
|
|
|
d.device_name as deviceName,
|
|
|
|
col.id as collect_id, h.search_num
|
|
|
|
d.device_weight as deviceWeight,
|
|
|
|
from ma_dev_info d
|
|
|
|
d.type_id as typeId,
|
|
|
|
left join bm_company_info c on d.own_co = c.company_id
|
|
|
|
d.ma_status as maStatus,
|
|
|
|
left join ma_user_collect col on d.ma_id = col.ma_id
|
|
|
|
d.brand as brand,
|
|
|
|
left join ma_hot_search h on d.ma_id = h.ma_id
|
|
|
|
d.model_name as modelName,
|
|
|
|
left join ma_type t on d.type_id = t.type_id
|
|
|
|
d.production_date as productionDate,
|
|
|
|
left join ma_type mt1 on d.type_id = mt1.type_id
|
|
|
|
d.working_hours as workingHours,
|
|
|
|
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
|
|
|
d.serial_number as serialNumber,
|
|
|
|
left join ma_type mt3 on mt2.parent_id = mt3.type_id
|
|
|
|
d.month_lease_price as monthLeasePrice,
|
|
|
|
where d.ma_id = #{maId} and d.is_active='1'
|
|
|
|
d.day_lease_price as dayLeasePrice,
|
|
|
|
|
|
|
|
d.person as person,
|
|
|
|
|
|
|
|
d.person_phone as personPhone,
|
|
|
|
|
|
|
|
c.company_name as companyName,
|
|
|
|
|
|
|
|
h.search_num as searchNum
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
ma_dev_info d
|
|
|
|
|
|
|
|
LEFT JOIN ma_hot_search h ON d.ma_id = h.ma_id
|
|
|
|
|
|
|
|
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
|
|
|
|
|
|
|
where
|
|
|
|
|
|
|
|
d.is_active='1' and d.ma_id = #{maId}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFile">
|
|
|
|
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFile">
|
|
|
|
@ -203,6 +195,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="maId != null and maId != '' ">ma_id,</if>
|
|
|
|
<if test="maId != null and maId != '' ">ma_id,</if>
|
|
|
|
<if test="code != null and code != '' ">code,</if>
|
|
|
|
<if test="code != null and code != '' ">code,</if>
|
|
|
|
|
|
|
|
<if test="deviceName != null and deviceName != '' ">device_name,</if>
|
|
|
|
|
|
|
|
<if test="deviceWeight != null and deviceWeight != '' ">device_weight,</if>
|
|
|
|
<if test="typeId != null and typeId != ''">type_id,</if>
|
|
|
|
<if test="typeId != null and typeId != ''">type_id,</if>
|
|
|
|
<if test="maStatus != null and maStatus != ''">ma_status,</if>
|
|
|
|
<if test="maStatus != null and maStatus != ''">ma_status,</if>
|
|
|
|
<if test="leaseScope != null and leaseScope != ''">lease_scope,</if>
|
|
|
|
<if test="leaseScope != null and leaseScope != ''">lease_scope,</if>
|
|
|
|
@ -378,9 +372,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
select d.*,t.type_name as device_name,t.parent_name as group_name,c.company_name,u.type as type,t.group_name as type_name,t.p_id as group_id,t.group_id as company_id
|
|
|
|
select d.*,t.type_name as device_name,t.parent_name as group_name,c.company_name,u.type as type,t.group_name as type_name,t.p_id as group_id,t.group_id as company_id
|
|
|
|
from ma_dev_info d
|
|
|
|
from ma_dev_info d
|
|
|
|
left join (select t.*, p.type_name as parent_name, p.type_id as p_id,mt.type_name as group_name, mt.type_id as group_id
|
|
|
|
left join (select t.*, p.type_name as parent_name, p.type_id as p_id,mt.type_name as group_name, mt.type_id as group_id
|
|
|
|
from ma_type_info t
|
|
|
|
from ma_type t
|
|
|
|
left join ma_type_info p on t.parent_id=p.type_id
|
|
|
|
left join ma_type p on t.parent_id=p.type_id
|
|
|
|
left join ma_type_info mt on p.parent_id = mt.type_id
|
|
|
|
left join ma_type mt on p.parent_id = mt.type_id
|
|
|
|
) t on d.type_id = t.type_id
|
|
|
|
) t on d.type_id = t.type_id
|
|
|
|
left join bm_company_info c on d.own_co = c.company_id
|
|
|
|
left join bm_company_info c on d.own_co = c.company_id
|
|
|
|
left join ma_up_off u on d.ma_id = u.ma_id ORDER BY d.create_time desc
|
|
|
|
left join ma_up_off u on d.ma_id = u.ma_id ORDER BY d.create_time desc
|
|
|
|
|