增加 从数据查询机坪

master
wanghao 1 month ago
parent 99594c0359
commit db2f62ba57

@ -12,10 +12,10 @@ spring:
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
enabled: true
url: jdbc:mysql://1.13.177.47:3306/bg_wheel_chocks?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Haiwei123456
# 初始连接数
initialSize: 5
# 最小连接池数量

@ -0,0 +1,41 @@
package com.ruoyi.device.domain;
import com.ruoyi.common.annotation.Excel;
public class LundangBaseStore {
/** 仓库id */
private Long storeId;
/** 仓库编号 */
@Excel(name = "仓库编号")
private String storeCode;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String storeName;
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
}

@ -0,0 +1,11 @@
package com.ruoyi.device.mapper;
import com.ruoyi.device.domain.LundangBaseStore;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface LundangMapper {
List<LundangBaseStore> selectLundangBaseStoreList();
}

@ -0,0 +1,21 @@
package com.ruoyi.device.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.device.domain.LundangBaseStore;
import com.ruoyi.device.mapper.LundangMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("lundang")
@DataSource(value = DataSourceType.SLAVE)
public class Lundang_BaseStoreServiceImpl {
@Autowired
private LundangMapper lundangMapper;
public List<LundangBaseStore> selectLundangBaseStoreList() {
return lundangMapper.selectLundangBaseStoreList();
}
}

@ -0,0 +1,18 @@
<?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">
<mapper namespace="com.ruoyi.device.mapper.LundangMapper">
<resultMap type="com.ruoyi.device.domain.LundangBaseStore" id="LundangResult">
<result property="storeId" column="store_id" />
<result property="storeCode" column="store_code" />
<result property="storeName" column="store_name" />
</resultMap>
<select id="selectLundangBaseStoreList" resultMap="LundangResult">
select store_id, store_code, store_name from base_store
</select>
</mapper>

@ -36,8 +36,13 @@
<div class="form-group">
<label class="col-sm-4 control-label">摆放桩位:</label>
<div class="col-sm-8">
<input name="locationName" class="form-control" type="text">
<!-- <input name="locationName" class="form-control" type="text">-->
<select class="form-control" name="locationName" th:with="type=${@lundang.selectLundangBaseStoreList()}">
<option th:each="dict : ${type}" th:text="${dict.storeName}" th:value="${dict.storeName}"></option>
</select>
</div>
</div>
</div>
<!-- <div class="col-xs-6">-->

@ -58,7 +58,10 @@
<div class="form-group">
<label class="col-sm-4 control-label">摆放桩位:</label>
<div class="col-sm-8">
<input name="locationName" th:field="*{locationName}" class="form-control" type="text">
<select class="form-control" name="locationName" th:field="*{locationName}" th:with="type=${@lundang.selectLundangBaseStoreList()}">
<option th:each="dict : ${type}" th:text="${dict.storeName}" th:value="${dict.storeName}"></option>
</select>
</div>
</div>
</div>

Loading…
Cancel
Save