装备类型配置页面,特征值设置还有部分未完成
This commit is contained in:
parent
f55cd76970
commit
1a3ea4d4c4
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||||
* 装备特征值管理
|
* 装备特征值管理
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/equipment/type/property")
|
@RequestMapping("/equipment/property")
|
||||||
public class EquipmentPropertyController {
|
public class EquipmentPropertyController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -96,7 +96,7 @@ public class EquipmentPropertyController {
|
||||||
* 删除特征值
|
* 删除特征值
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public AjaxResult delete(@PathVariable Integer id) {
|
public AjaxResult delete(@PathVariable Long id) {
|
||||||
equipmentPropertyService.delete(id);
|
equipmentPropertyService.delete(id);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,27 @@ import com.bonus.material.devConfig.domain.EquipmentProperty;
|
||||||
import com.bonus.material.devConfig.domain.EquipmentPropertyDTO;
|
import com.bonus.material.devConfig.domain.EquipmentPropertyDTO;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface EquipmentPropertyMapper {
|
public interface EquipmentPropertyMapper {
|
||||||
void deleteById(Integer id);
|
void deleteById(@Param("id") Long id);
|
||||||
|
|
||||||
void update(EquipmentProperty equipmentProperty);
|
void update(EquipmentProperty equipmentProperty);
|
||||||
|
|
||||||
void insert(EquipmentProperty equipmentProperty);
|
void insert(EquipmentProperty equipmentProperty);
|
||||||
|
|
||||||
List<EquipmentProperty> selectByTypeId(Long typeId);
|
List<EquipmentProperty> selectByTypeId(@Param("typeId") Long typeId);
|
||||||
|
|
||||||
EquipmentProperty selectById(Long id);
|
EquipmentProperty selectById(@Param("typeId") Long id);
|
||||||
|
|
||||||
List<EquipmentProperty> selectAll();
|
List<EquipmentProperty> selectAll();
|
||||||
|
|
||||||
|
|
||||||
// 新增关联查询方法
|
// 新增关联查询方法
|
||||||
List<EquipmentPropertyDTO> selectTypeWithProperties(Long typeId);
|
List<EquipmentPropertyDTO> selectTypeWithProperties(@Param("typeId") Long typeId);
|
||||||
List<EquipmentPropertyDTO> selectAllTypesWithProperties();
|
List<EquipmentPropertyDTO> selectAllTypesWithProperties();
|
||||||
EquipmentPropertyDTO selectTypeDetailWithProperties(Long typeId);
|
EquipmentPropertyDTO selectTypeDetailWithProperties(@Param("typeId") Long typeId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ public interface EquipmentPropertyService {
|
||||||
|
|
||||||
void update(EquipmentProperty equipmentProperty);
|
void update(EquipmentProperty equipmentProperty);
|
||||||
|
|
||||||
void delete(Integer id);
|
void delete(Long id);
|
||||||
|
|
||||||
List<EquipmentPropertyDTO> getTypeWithProperties(Long typeId);
|
List<EquipmentPropertyDTO> getTypeWithProperties(Long typeId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class EquipmentPropertyServiceImpl implements EquipmentPropertyService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(Integer id) {
|
public void delete(Long id) {
|
||||||
equipmentPropertyMapper.deleteById(id);
|
equipmentPropertyMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,22 +68,30 @@
|
||||||
|
|
||||||
<!-- 查询所有特征值 -->
|
<!-- 查询所有特征值 -->
|
||||||
<select id="selectAll" resultMap="EquipmentPropertyResult">
|
<select id="selectAll" resultMap="EquipmentPropertyResult">
|
||||||
SELECT id, type_id, must_have, input_type, property_name, property_value, create_time
|
SELECT
|
||||||
FROM equipment_property
|
MIN(id) as id,
|
||||||
|
'' as type_id,
|
||||||
|
must_have,
|
||||||
|
input_type,
|
||||||
|
property_name,
|
||||||
|
'' as property_value,
|
||||||
|
MAX(create_time) as create_time
|
||||||
|
FROM ma_type_properties
|
||||||
|
GROUP BY property_name
|
||||||
ORDER BY create_time DESC
|
ORDER BY create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据ID查询特征值 -->
|
<!-- 根据ID查询特征值 -->
|
||||||
<select id="selectById" parameterType="java.lang.Integer" resultMap="EquipmentPropertyResult">
|
<select id="selectById" resultMap="EquipmentPropertyResult">
|
||||||
SELECT id, type_id, must_have, input_type, property_name, property_value, create_time
|
SELECT id, type_id, must_have, input_type, property_name, property_value, create_time
|
||||||
FROM equipment_property
|
FROM ma_type_properties
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据类型ID查询特征值 -->
|
<!-- 根据类型ID查询特征值 -->
|
||||||
<select id="selectByTypeId" parameterType="java.lang.Integer" resultMap="EquipmentPropertyResult">
|
<select id="selectByTypeId" resultMap="EquipmentPropertyResult">
|
||||||
SELECT id, type_id, must_have, input_type, property_name, property_value, create_time
|
SELECT id, type_id, must_have, input_type, property_name, property_value, create_time
|
||||||
FROM equipment_property
|
FROM ma_type_properties
|
||||||
WHERE type_id = #{typeId}
|
WHERE type_id = #{typeId}
|
||||||
ORDER BY create_time DESC
|
ORDER BY create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -104,8 +112,8 @@
|
||||||
ep.property_name,
|
ep.property_name,
|
||||||
ep.property_value,
|
ep.property_value,
|
||||||
ep.create_time as property_create_time
|
ep.create_time as property_create_time
|
||||||
FROM equipment_type et
|
FROM ma_type et
|
||||||
LEFT JOIN equipment_property ep ON et.type_id = ep.type_id
|
LEFT JOIN ma_type_propertis ep ON et.type_id = ep.type_id
|
||||||
WHERE et.type_id = #{typeId}
|
WHERE et.type_id = #{typeId}
|
||||||
ORDER BY ep.create_time DESC
|
ORDER BY ep.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -126,8 +134,8 @@
|
||||||
ep.property_name,
|
ep.property_name,
|
||||||
ep.property_value,
|
ep.property_value,
|
||||||
ep.create_time as property_create_time
|
ep.create_time as property_create_time
|
||||||
FROM equipment_type et
|
FROM ma_type et
|
||||||
LEFT JOIN equipment_property ep ON et.type_id = ep.type_id
|
LEFT JOIN ma_type_properties ep ON et.type_id = ep.type_id
|
||||||
WHERE et.status = '0'
|
WHERE et.status = '0'
|
||||||
ORDER BY et.type_id, ep.create_time DESC
|
ORDER BY et.type_id, ep.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -149,8 +157,8 @@
|
||||||
ep.property_name,
|
ep.property_name,
|
||||||
ep.property_value,
|
ep.property_value,
|
||||||
ep.create_time
|
ep.create_time
|
||||||
FROM equipment_type et
|
FROM ma_type et
|
||||||
LEFT JOIN equipment_property ep ON et.type_id = ep.type_id
|
LEFT JOIN ma_type_properties ep ON et.type_id = ep.type_id
|
||||||
WHERE et.type_id = #{typeId}
|
WHERE et.type_id = #{typeId}
|
||||||
ORDER BY ep.create_time DESC
|
ORDER BY ep.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -158,7 +166,7 @@
|
||||||
<!-- 新增特征值 -->
|
<!-- 新增特征值 -->
|
||||||
<insert id="insert" parameterType="com.bonus.material.devConfig.domain.EquipmentProperty"
|
<insert id="insert" parameterType="com.bonus.material.devConfig.domain.EquipmentProperty"
|
||||||
useGeneratedKeys="true" keyProperty="id">
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO equipment_property (
|
INSERT INTO ma_type_properties (
|
||||||
type_id,
|
type_id,
|
||||||
must_have,
|
must_have,
|
||||||
input_type,
|
input_type,
|
||||||
|
|
@ -177,7 +185,7 @@
|
||||||
|
|
||||||
<!-- 更新特征值 -->
|
<!-- 更新特征值 -->
|
||||||
<update id="update" parameterType="com.bonus.material.devConfig.domain.EquipmentProperty">
|
<update id="update" parameterType="com.bonus.material.devConfig.domain.EquipmentProperty">
|
||||||
UPDATE equipment_property
|
UPDATE ma_type_properties
|
||||||
<set>
|
<set>
|
||||||
<if test="typeId != null">type_id = #{typeId},</if>
|
<if test="typeId != null">type_id = #{typeId},</if>
|
||||||
<if test="mustHave != null and mustHave != ''">must_have = #{mustHave},</if>
|
<if test="mustHave != null and mustHave != ''">must_have = #{mustHave},</if>
|
||||||
|
|
@ -189,8 +197,8 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 根据ID删除特征值 -->
|
<!-- 根据ID删除特征值 -->
|
||||||
<delete id="deleteById" parameterType="java.lang.Integer">
|
<delete id="deleteById" >
|
||||||
DELETE FROM equipment_property
|
DELETE FROM ma_type_properties
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue