Commit 561a3109 by xiaoyj

设备信息

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21590 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 5798036b
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import com.glsx.ordercenter.pojo.SysDevice; import com.glsx.ordercenter.pojo.SysDevice;
import com.glsx.ordercenter.pojo.SysDeviceExample;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface SysDeviceMapper { public interface SysDeviceMapper {
int countByExample(SysDeviceExample example);
int deleteByExample(SysDeviceExample example);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(SysDevice record); int insert(SysDevice record);
int insertSelective(SysDevice record); int insertSelective(SysDevice record);
List<SysDevice> selectByExample(SysDeviceExample example);
SysDevice selectByPrimaryKey(Integer id); SysDevice selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysDevice record, @Param("example") SysDeviceExample example);
int updateByExample(@Param("record") SysDevice record, @Param("example") SysDeviceExample example);
int updateByPrimaryKeySelective(SysDevice record); int updateByPrimaryKeySelective(SysDevice record);
int updateByPrimaryKey(SysDevice record); int updateByPrimaryKey(SysDevice record);
List<SysDevice> catIndentDevices(String indentNo);
} }
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glsx.ordercenter.mapper.SysDeviceMapper" > <mapper namespace="com.glsx.ordercenter.mapper.SysDeviceMapper" >
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysDevice" > <resultMap id="BaseResultMap" type="com.xyj.generator.pojo.SysDevice" >
<id column="id" property="id" jdbcType="INTEGER" /> <id column="id" property="id" jdbcType="INTEGER" />
<result column="device_type" property="deviceType" jdbcType="VARCHAR" /> <result column="device_type" property="deviceType" jdbcType="VARCHAR" />
<result column="device_no" property="deviceNo" jdbcType="VARCHAR" /> <result column="device_no" property="deviceNo" jdbcType="VARCHAR" />
...@@ -77,9 +77,22 @@ ...@@ -77,9 +77,22 @@
id, device_type, device_no, device_status, user_id, indent_no, stock_time, remark, id, device_type, device_no, device_status, user_id, indent_no, stock_time, remark,
create_time, create_by, update_time, update_by create_time, create_by, update_time, update_by
</sql> </sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xyj.generator.pojo.SysDeviceExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from sys_device
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from sys_device from sys_device
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -88,20 +101,25 @@ ...@@ -88,20 +101,25 @@
delete from sys_device delete from sys_device
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.xyj.generator.pojo.SysDeviceExample" >
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysDevice" > delete from sys_device
insert into sys_device (id, device_type, device_no, <if test="_parameter != null" >
device_status, user_id, indent_no, <include refid="Example_Where_Clause" />
stock_time, remark, create_time, </if>
create_by, update_time, update_by </delete>
) <insert id="insert" parameterType="com.xyj.generator.pojo.SysDevice" >
values (#{id,jdbcType=INTEGER}, #{deviceType,jdbcType=VARCHAR}, #{deviceNo,jdbcType=VARCHAR}, insert into sys_device (id, device_type, device_no,
#{deviceStatus,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{indentNo,jdbcType=VARCHAR}, device_status, user_id, indent_no,
#{stockTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, stock_time, remark, create_time,
#{createBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER} create_by, update_time, update_by
) )
values (#{id,jdbcType=INTEGER}, #{deviceType,jdbcType=VARCHAR}, #{deviceNo,jdbcType=VARCHAR},
#{deviceStatus,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{indentNo,jdbcType=VARCHAR},
#{stockTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysDevice" > <insert id="insertSelective" parameterType="com.xyj.generator.pojo.SysDevice" >
insert into sys_device insert into sys_device
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" > <if test="id != null" >
...@@ -180,7 +198,74 @@ ...@@ -180,7 +198,74 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.xyj.generator.pojo.SysDeviceExample" resultType="java.lang.Integer" >
select count(*) from sys_device
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update sys_device
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.deviceType != null" >
device_type = #{record.deviceType,jdbcType=VARCHAR},
</if>
<if test="record.deviceNo != null" >
device_no = #{record.deviceNo,jdbcType=VARCHAR},
</if>
<if test="record.deviceStatus != null" >
device_status = #{record.deviceStatus,jdbcType=INTEGER},
</if>
<if test="record.userId != null" >
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.indentNo != null" >
indent_no = #{record.indentNo,jdbcType=VARCHAR},
</if>
<if test="record.stockTime != null" >
stock_time = #{record.stockTime,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null" >
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createBy != null" >
create_by = #{record.createBy,jdbcType=INTEGER},
</if>
<if test="record.updateTime != null" >
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null" >
update_by = #{record.updateBy,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update sys_device
set id = #{record.id,jdbcType=INTEGER},
device_type = #{record.deviceType,jdbcType=VARCHAR},
device_no = #{record.deviceNo,jdbcType=VARCHAR},
device_status = #{record.deviceStatus,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
indent_no = #{record.indentNo,jdbcType=VARCHAR},
stock_time = #{record.stockTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_by = #{record.createBy,jdbcType=INTEGER},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.xyj.generator.pojo.SysDevice" > <update id="updateByPrimaryKeySelective" parameterType="com.xyj.generator.pojo.SysDevice" >
update sys_device update sys_device
<set > <set >
...@@ -220,33 +305,19 @@ ...@@ -220,33 +305,19 @@
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysDevice" > <update id="updateByPrimaryKey" parameterType="com.xyj.generator.pojo.SysDevice" >
update sys_device update sys_device
set device_type = #{deviceType,jdbcType=VARCHAR}, set device_type = #{deviceType,jdbcType=VARCHAR},
device_no = #{deviceNo,jdbcType=VARCHAR}, device_no = #{deviceNo,jdbcType=VARCHAR},
device_status = #{deviceStatus,jdbcType=INTEGER}, device_status = #{deviceStatus,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER}, user_id = #{userId,jdbcType=INTEGER},
indent_no = #{indentNo,jdbcType=VARCHAR}, indent_no = #{indentNo,jdbcType=VARCHAR},
stock_time = #{stockTime,jdbcType=TIMESTAMP}, stock_time = #{stockTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER}, create_by = #{createBy,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=INTEGER} update_by = #{updateBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="catIndentDevices" resultMap="BaseResultMap">
SELECT
sdd.data_value AS deviceType,
d.deviceNo
FROM
sys_device sd
INNER JOIN sys_dict_data sdd ON sd.device_type = sdd.dict_type
WHERE
sd.indent_no = #{indentNo]
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!