parent
d99c25a92d
commit
b19225edbe
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.dao.IRegionalismCodeDao">
|
||||
<resultMap id="getEntityByText" type="com.platform.entities.RegionalismEntity">
|
||||
<id property="code" column="code" jdbcType="VARCHAR" />
|
||||
<result property="cityName" column="city_name" jdbcType="VARCHAR" />
|
||||
<result property="districtName" column="district_name" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
code,city_name,district_name
|
||||
</sql>
|
||||
|
||||
<!-- 获取数据全部记录信息 -->
|
||||
<select id="findAllRegionalism" resultMap="getEntityByText">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM regionalism_info
|
||||
order by code
|
||||
<if test="PagerOptions.limit > 0">
|
||||
LIMIT #{PagerOptions.limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findSubRegionalism" parameterType="com.platform.entities.RegionalismEntity" resultMap="getEntityByText">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM regionalism_info
|
||||
<where>
|
||||
<if test="code != null and code != ''">
|
||||
AND code LIKE CONCAT(CONCAT('%', #{code}), '%')
|
||||
</if>
|
||||
<if test="cityName != null and cityName != ''">
|
||||
AND city_name LIKE CONCAT(CONCAT('%', #{cityName}), '%')
|
||||
</if>
|
||||
<if test="districtName != null and districtName != ''">
|
||||
AND district_name LIKE CONCAT(CONCAT('%', #{districtName}), '%')
|
||||
</if>
|
||||
</where>
|
||||
order by code
|
||||
<if test="PagerOptions.limit > 0">
|
||||
LIMIT #{PagerOptions.limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.dao.ISystemCodeDao">
|
||||
<resultMap id="getEntityByText" type="com.platform.entities.SystemEntity">
|
||||
<id property="code" column="code" jdbcType="INTEGER" />
|
||||
<result property="systemName" column="system_name" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
code,system_name
|
||||
</sql>
|
||||
|
||||
<!-- 获取数据全部记录信息 -->
|
||||
<select id="findAllSystem" resultMap="getEntityByText">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM system_info
|
||||
order by code
|
||||
<if test="PagerOptions.limit > 0">
|
||||
LIMIT #{PagerOptions.limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findSubSystem" parameterType="com.platform.entities.SystemEntity" resultMap="getEntityByText">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM system_info
|
||||
<where>
|
||||
<if test="code > 0">
|
||||
AND code = #{code}
|
||||
</if>
|
||||
<if test="cityName != null and cityName != ''">
|
||||
AND city_name LIKE CONCAT(CONCAT('%', #{cityName}), '%')
|
||||
</if>
|
||||
<if test="districtName != null and districtName != ''">
|
||||
AND district_name LIKE CONCAT(CONCAT('%', #{districtName}), '%')
|
||||
</if>
|
||||
</where>
|
||||
order by code
|
||||
<if test="PagerOptions.limit > 0">
|
||||
LIMIT #{PagerOptions.limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,53 @@
|
||||
package com.platform.entities;
|
||||
|
||||
public class RegionalismEntity {
|
||||
|
||||
private String code;
|
||||
|
||||
private String cityName;
|
||||
|
||||
private String districtName;
|
||||
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cityName
|
||||
*/
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cityName the cityName to set
|
||||
*/
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the districtName
|
||||
*/
|
||||
public String getDistrictName() {
|
||||
return districtName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param districtName the districtName to set
|
||||
*/
|
||||
public void setDistrictName(String districtName) {
|
||||
this.districtName = districtName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.platform.entities;
|
||||
|
||||
public class SystemEntity {
|
||||
|
||||
private int code;
|
||||
|
||||
private String systemName;
|
||||
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code the code to set
|
||||
*/
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the systemName
|
||||
*/
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param systemName the systemName to set
|
||||
*/
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.platform.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.platform.dao.DataInfoDao;
|
||||
import com.platform.dao.IRegionalismCodeDao;
|
||||
import com.platform.dao.ISystemCodeDao;
|
||||
import com.platform.entities.RegionalismEntity;
|
||||
import com.platform.entities.SystemEntity;
|
||||
import com.platform.service.ICodeService;
|
||||
|
||||
public class CodeServiceImpl implements ICodeService {
|
||||
|
||||
@Resource(name = "systemCodeDao")
|
||||
private ISystemCodeDao systemCodeDao;
|
||||
|
||||
@Resource(name = "regionalismCodeDao")
|
||||
private IRegionalismCodeDao regionalismCodeDao;
|
||||
|
||||
@Override
|
||||
public List<SystemEntity> findSystem(SystemEntity sys) throws Exception {
|
||||
List<SystemEntity> result = new ArrayList<SystemEntity>();
|
||||
result = systemCodeDao.findSubSystem(sys);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RegionalismEntity> findRegionalism(RegionalismEntity region) throws Exception {
|
||||
List<RegionalismEntity> result = regionalismCodeDao.findSubRegionalism(region);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue