Commit 4ee81992 by zhengxj

finish 修正代码on 20190126 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17134 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a37d4e99
...@@ -46,11 +46,11 @@ public class AreaServiceImpl implements IAreaService { ...@@ -46,11 +46,11 @@ public class AreaServiceImpl implements IAreaService {
@Autowired @Autowired
private SysAreaMapper areaDao; private SysAreaMapper sysAreaMapper;
@Override @Override
public List<SysArea> selectByExample(SysAreaExample example) { public List<SysArea> selectByExample(SysAreaExample example) {
return areaDao.selectByExample(example); return sysAreaMapper.selectByExample(example);
} }
...@@ -58,13 +58,13 @@ public class AreaServiceImpl implements IAreaService { ...@@ -58,13 +58,13 @@ public class AreaServiceImpl implements IAreaService {
public SysArea getAllChargeItems(Integer id) { public SysArea getAllChargeItems(Integer id) {
SysAreaExample example=new SysAreaExample (); SysAreaExample example=new SysAreaExample ();
example.createCriteria().andIdEqualTo(id); example.createCriteria().andIdEqualTo(id);
List<SysArea> child = areaDao.selectByExample(example); List<SysArea> child = sysAreaMapper.selectByExample(example);
example.clear(); example.clear();
example.createCriteria().andIdEqualTo(child.get(0).getParentId()); example.createCriteria().andIdEqualTo(child.get(0).getParentId());
List<SysArea> parent= areaDao.selectByExample(example); List<SysArea> parent= sysAreaMapper.selectByExample(example);
example.clear(); example.clear();
example.createCriteria().andIdEqualTo(parent.get(0).getParentId()); example.createCriteria().andIdEqualTo(parent.get(0).getParentId());
SysArea prandPa= areaDao.selectByExample(example).get(0); SysArea prandPa= sysAreaMapper.selectByExample(example).get(0);
parent.get(0).setChildren(child); parent.get(0).setChildren(child);
prandPa.setChildren(parent); prandPa.setChildren(parent);
return prandPa; return prandPa;
......
<?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.glsx.ordercenter.mapper.SysMechanicMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.user.SysMechanic">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="district" jdbcType="INTEGER" property="district" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="work_time_start" jdbcType="VARCHAR" property="workTimeStart" />
<result column="work_time_end" jdbcType="VARCHAR" property="workTimeEnd" />
<result column="dispatch_type" jdbcType="TINYINT" property="dispatchType" />
<result column="service_type" jdbcType="TINYINT" property="serviceType" />
<result column="IDCard" jdbcType="VARCHAR" property="idcard" />
<result column="mechanic_status" jdbcType="TINYINT" property="mechanicStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, district, address, work_time_start, work_time_end, dispatch_type, service_type,
IDCard, mechanic_status
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.user.SysMechanicExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_mechanic
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_mechanic
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_mechanic
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_mechanic (user_id, district, address,
work_time_start, work_time_end, dispatch_type,
service_type, IDCard, mechanic_status
)
values (#{userId,jdbcType=INTEGER}, #{district,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR},
#{workTimeStart,jdbcType=VARCHAR}, #{workTimeEnd,jdbcType=VARCHAR}, #{dispatchType,jdbcType=TINYINT},
#{serviceType,jdbcType=TINYINT}, #{idcard,jdbcType=VARCHAR}, #{mechanicStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_mechanic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="district != null">
district,
</if>
<if test="address != null">
address,
</if>
<if test="workTimeStart != null">
work_time_start,
</if>
<if test="workTimeEnd != null">
work_time_end,
</if>
<if test="dispatchType != null">
dispatch_type,
</if>
<if test="serviceType != null">
service_type,
</if>
<if test="idcard != null">
IDCard,
</if>
<if test="mechanicStatus != null">
mechanic_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="district != null">
#{district,jdbcType=INTEGER},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="workTimeStart != null">
#{workTimeStart,jdbcType=VARCHAR},
</if>
<if test="workTimeEnd != null">
#{workTimeEnd,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
#{dispatchType,jdbcType=TINYINT},
</if>
<if test="serviceType != null">
#{serviceType,jdbcType=TINYINT},
</if>
<if test="idcard != null">
#{idcard,jdbcType=VARCHAR},
</if>
<if test="mechanicStatus != null">
#{mechanicStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.user.SysMechanicExample" resultType="java.lang.Long">
select count(*) from sys_mechanic
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
update sys_mechanic
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="district != null">
district = #{district,jdbcType=INTEGER},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="workTimeStart != null">
work_time_start = #{workTimeStart,jdbcType=VARCHAR},
</if>
<if test="workTimeEnd != null">
work_time_end = #{workTimeEnd,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
dispatch_type = #{dispatchType,jdbcType=TINYINT},
</if>
<if test="serviceType != null">
service_type = #{serviceType,jdbcType=TINYINT},
</if>
<if test="idcard != null">
IDCard = #{idcard,jdbcType=VARCHAR},
</if>
<if test="mechanicStatus != null">
mechanic_status = #{mechanicStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
update sys_mechanic
set user_id = #{userId,jdbcType=INTEGER},
district = #{district,jdbcType=INTEGER},
address = #{address,jdbcType=VARCHAR},
work_time_start = #{workTimeStart,jdbcType=VARCHAR},
work_time_end = #{workTimeEnd,jdbcType=VARCHAR},
dispatch_type = #{dispatchType,jdbcType=TINYINT},
service_type = #{serviceType,jdbcType=TINYINT},
IDCard = #{idcard,jdbcType=VARCHAR},
mechanic_status = #{mechanicStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.ordercenter.mapper.SysMerchantMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.user.SysMerchant">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
<result column="district" jdbcType="INTEGER" property="district" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="service_type" jdbcType="TINYINT" property="serviceType" />
<result column="merchant_status" jdbcType="TINYINT" property="merchantStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, shop_name, district, address, service_type, merchant_status
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.user.SysMerchantExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_merchant
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_merchant
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_merchant
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.user.SysMerchant">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_merchant (user_id, shop_name, district,
address, service_type, merchant_status
)
values (#{userId,jdbcType=INTEGER}, #{shopName,jdbcType=VARCHAR}, #{district,jdbcType=INTEGER},
#{address,jdbcType=VARCHAR}, #{serviceType,jdbcType=TINYINT}, #{merchantStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.user.SysMerchant">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_merchant
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="shopName != null">
shop_name,
</if>
<if test="district != null">
district,
</if>
<if test="address != null">
address,
</if>
<if test="serviceType != null">
service_type,
</if>
<if test="merchantStatus != null">
merchant_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="shopName != null">
#{shopName,jdbcType=VARCHAR},
</if>
<if test="district != null">
#{district,jdbcType=INTEGER},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="serviceType != null">
#{serviceType,jdbcType=TINYINT},
</if>
<if test="merchantStatus != null">
#{merchantStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.user.SysMerchantExample" resultType="java.lang.Long">
select count(*) from sys_merchant
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.user.SysMerchant">
update sys_merchant
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="shopName != null">
shop_name = #{shopName,jdbcType=VARCHAR},
</if>
<if test="district != null">
district = #{district,jdbcType=INTEGER},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="serviceType != null">
service_type = #{serviceType,jdbcType=TINYINT},
</if>
<if test="merchantStatus != null">
merchant_status = #{merchantStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.user.SysMerchant">
update sys_merchant
set user_id = #{userId,jdbcType=INTEGER},
shop_name = #{shopName,jdbcType=VARCHAR},
district = #{district,jdbcType=INTEGER},
address = #{address,jdbcType=VARCHAR},
service_type = #{serviceType,jdbcType=TINYINT},
merchant_status = #{merchantStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -216,77 +216,6 @@ ...@@ -216,77 +216,6 @@
</trim> </trim>
</insert> </insert>
<insert id="insertManager" parameterType="com.glsx.ordercenter.pojo.user.SysManager">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_manager
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="mail != null">
mail,
</if>
<if test="occupation != null">
occupation,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="mail != null">
#{mail,jdbcType=VARCHAR},
</if>
<if test="occupation != null">
#{occupation,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="insertSysMerchant" parameterType="com.glsx.ordercenter.pojo.user.SysMerchant">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_merchant
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="district != null">
district,
</if>
<if test="address != null">
address,
</if>
<if test="shopName != null">
shop_name,
</if>
<if test="serviceType != null">
service_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="district != null">
#{district,jdbcType=INTEGER},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="shopName != null">
#{shopName,jdbcType=VARCHAR},
</if>
<if test="serviceType != null">
#{serviceType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="insertSysMechanic" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic"> <insert id="insertSysMechanic" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -466,66 +395,9 @@ ...@@ -466,66 +395,9 @@
</update> </update>
<update id="updateManager" parameterType="com.glsx.ordercenter.pojo.user.SysManager">
update sys_manager
<set>
<if test="mail != null">
mail = #{mail,jdbcType=VARCHAR},
</if>
<if test="occupation != null">
occupation = #{occupation,jdbcType=VARCHAR},
</if>
</set>
where user_id = #{id,jdbcType=INTEGER}
</update>
<update id="updateSysMerchant" parameterType="com.glsx.ordercenter.pojo.user.SysMerchant">
update sys_merchant
<set>
<if test="district != null">
district = #{district,jdbcType=INTEGER},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="shopName != null">
shop_name = #{shopName,jdbcType=VARCHAR},
</if>
<if test="serviceType != null">
service_type = #{serviceType,jdbcType=INTEGER},
</if>
</set>
where user_id = #{id,jdbcType=INTEGER}
</update>
<update id="updateSysMechanic" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
update sys_merchant
<set>
<if test="district != null">
district = #{district,jdbcType=INTEGER},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="workTimeStart != null">
work_time_start = #{workTimeStart,jdbcType=TIMESTAMP},
</if>
<if test="workTimeEnd != null">
work_time_end = #{workTimeEnd,jdbcType=TIMESTAMP},
</if>
<if test="dispatchType != null">
dispatch_type = #{dispatchType,jdbcType=INTEGER},
</if>
<if test="serviceType != null">
service_type = #{serviceType,jdbcType=INTEGER},
</if>
<if test="IDCard != null">
IDCard = #{IDCard,jdbcType=VARCHAR},
</if>
</set>
where user_id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.user.SysUser"> <update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!