|
@@ -1,68 +1,105 @@
|
|
|
<?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.xintong.visualinspection.dao.master.TaskDao" >
|
|
<mapper namespace="com.xintong.visualinspection.dao.master.TaskDao" >
|
|
|
- <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.User" >
|
|
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.Task" >
|
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="username" property="username" jdbcType="VARCHAR" />
|
|
|
|
|
- <result column="age" property="age" jdbcType="INTEGER" />
|
|
|
|
|
- <result column="password" property="password" jdbcType="VARCHAR" />
|
|
|
|
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="check_status" property="check_status" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="video_id" property="video_id" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="create_time" property="create_time" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="update_time" property="update_time" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="start_time" property="start_time" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="end_time" property="end_time" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="checkman" property="checkman" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="checked_person" property="checked_person" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="checked_dept" property="checked_dept" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="rule_id" property="rule_id" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="checked_location" property="checked_location" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="checked_location_type" property="checked_location_type" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
- <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
|
|
|
|
|
|
|
+ <resultMap id="taskStatusMap" type="com.xintong.visualinspection.bean.TaskStatus">
|
|
|
<id property="id" column="ID"/>
|
|
<id property="id" column="ID"/>
|
|
|
- <result property="username" column="username"/>
|
|
|
|
|
- <result property="password" column="PASSWORD"/>
|
|
|
|
|
- <collection property="roles" ofType="com.xintong.visualinspection.bean.Role">
|
|
|
|
|
- <result column="name" property="name"/>
|
|
|
|
|
- </collection>
|
|
|
|
|
|
|
+ <result property="task_id" column="task_id"/>
|
|
|
|
|
+ <result property="update_time" column="update_time"/>
|
|
|
|
|
+ <result property="update_user" column="update_user"/>
|
|
|
|
|
+ <result property="update_username" column="update_username"/>
|
|
|
|
|
+ <result property="check_status" column="check_status"/>
|
|
|
|
|
+ <result property="check_status_name" column="check_status_name"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="getAll" resultMap="BaseResultMap" >
|
|
<select id="getAll" resultMap="BaseResultMap" >
|
|
|
- SELECT
|
|
|
|
|
- id,username,age,password
|
|
|
|
|
- FROM sys_user
|
|
|
|
|
|
|
+ SELECT *
|
|
|
|
|
+ FROM check_task
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getOne" parameterType="java.lang.Long" resultMap="BaseResultMap" >
|
|
<select id="getOne" parameterType="java.lang.Long" resultMap="BaseResultMap" >
|
|
|
- SELECT
|
|
|
|
|
- id,username,age,password
|
|
|
|
|
- FROM sys_user
|
|
|
|
|
|
|
+ SELECT *
|
|
|
|
|
+ FROM check_task
|
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="getList" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
|
|
|
|
|
+ SELECT *
|
|
|
|
|
+ FROM check_task
|
|
|
|
|
+ WHERE 1=1
|
|
|
|
|
+ <if test="check_status != null">AND check_status = #{check_status}</if>
|
|
|
|
|
+ <if test="start_time != null">AND create_time >= #{start_time}</if>
|
|
|
|
|
+ <if test="end_time != null">AND create_time <= #{end_time}</if>
|
|
|
|
|
+ <if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>
|
|
|
|
|
+ <if test="checkman != null">AND checkman = #{checkman}</if>
|
|
|
|
|
+ <if test="checked_person != null">AND checked_person = #{checked_person}</if>
|
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
- <insert id="insert" parameterType="com.xintong.visualinspection.bean.User" >
|
|
|
|
|
- INSERT INTO
|
|
|
|
|
- sys_user
|
|
|
|
|
- (username,age,password,TRUENAME,ORGANID,BIRTH,AGE,MOBILE,POSITIONID,SEX,WORKNO,IDNO)
|
|
|
|
|
|
|
+ <insert id="insert" parameterType="com.xintong.visualinspection.bean.Task" >
|
|
|
|
|
+ INSERT INTO check_task
|
|
|
|
|
+ (name,check_status,video_id,create_time,update_time,start_time,
|
|
|
|
|
+ end_time,checkman,checked_person,checked_dept,rule_id,checked_location,
|
|
|
|
|
+ checked_location_type,remark
|
|
|
|
|
+ )
|
|
|
|
|
+ VALUES
|
|
|
|
|
+ (#{name}, #{check_status},#{video_id},#{create_time},#{update_time},#{start_time},
|
|
|
|
|
+ #{end_time},#{checkman},#{checked_person},#{checked_dept},#{rule_id},#{checked_location},
|
|
|
|
|
+ #{checked_location_type},#{remark}
|
|
|
|
|
+ )
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertStatus" parameterType="com.xintong.visualinspection.bean.TaskStatus" >
|
|
|
|
|
+ INSERT INTO check_task_status
|
|
|
|
|
+ (task_id,update_time,update_user,update_username,check_status,
|
|
|
|
|
+ check_status_name
|
|
|
|
|
+ )
|
|
|
VALUES
|
|
VALUES
|
|
|
- (#{username}, #{age},#{password},#{truename},#{deptId},#{birth},#{age},#{mobile},#{positionId},#{sex},#{workno},#{idno})
|
|
|
|
|
|
|
+ (#{task_id}, #{update_time},#{update_user},#{update_username},#{check_status},
|
|
|
|
|
+ #{check_status_name}
|
|
|
|
|
+ )
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
- <update id="update" parameterType="com.xintong.visualinspection.bean.User" >
|
|
|
|
|
|
|
+ <update id="update" parameterType="com.xintong.visualinspection.bean.Task" >
|
|
|
UPDATE
|
|
UPDATE
|
|
|
- sys_user
|
|
|
|
|
|
|
+ check_task
|
|
|
SET
|
|
SET
|
|
|
- <if test="username != null">userName = #{username},</if>
|
|
|
|
|
- <if test="age != null">age = #{age},</if>
|
|
|
|
|
- <if test="password != null">password = #{password},</if>
|
|
|
|
|
- id = #{id}
|
|
|
|
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
|
|
+ <if test="check_status != null">check_status = #{check_status},</if>
|
|
|
|
|
+ <if test="video_id != null">video_id = #{video_id},</if>
|
|
|
|
|
+ <if test="update_time != null">update_time = #{update_time},</if>
|
|
|
|
|
+ <if test="start_time != null">start_time = #{start_time},</if>
|
|
|
|
|
+ <if test="end_time != null">end_time = #{end_time},</if>
|
|
|
|
|
+ <if test="checkman != null">checkman = #{checkman},</if>
|
|
|
|
|
+ <if test="checked_person != null">checked_person = #{checked_person},</if>
|
|
|
|
|
+ <if test="checked_dept != null">checked_dept = #{checked_dept},</if>
|
|
|
|
|
+ <if test="rule_id != null">rule_id = #{rule_id},</if>
|
|
|
|
|
+ <if test="checked_location != null">checked_location = #{checked_location},</if>
|
|
|
|
|
+ <if test="checked_location_type != null">checked_location_type = #{checked_location_type},</if>
|
|
|
|
|
+ remark = #{remark}
|
|
|
WHERE
|
|
WHERE
|
|
|
id = #{id}
|
|
id = #{id}
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="delete" parameterType="java.lang.Long" >
|
|
<delete id="delete" parameterType="java.lang.Long" >
|
|
|
DELETE FROM
|
|
DELETE FROM
|
|
|
- sys_user
|
|
|
|
|
|
|
+ check_task
|
|
|
WHERE
|
|
WHERE
|
|
|
id =#{id}
|
|
id =#{id}
|
|
|
</delete>
|
|
</delete>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <select id="findByUserName" parameterType="String" resultMap="userMap">
|
|
|
|
|
- select u.*
|
|
|
|
|
- ,r.name
|
|
|
|
|
- from sys_user u
|
|
|
|
|
- LEFT JOIN sys_role_user sru on u.id= sru.Sys_User_id
|
|
|
|
|
- LEFT JOIN sys_role r on sru.sys_role_id=r.id
|
|
|
|
|
- where username= #{username}
|
|
|
|
|
- </select>
|
|
|
|
|
</mapper>
|
|
</mapper>
|