|
|
@@ -1,68 +1,74 @@
|
|
|
<?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.xintong.visualinspection.dao.master.ScoreDao" >
|
|
|
- <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.User" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.Score" >
|
|
|
<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" />
|
|
|
- </resultMap>
|
|
|
- <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
|
|
|
- <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 column="task_id" property="task_id" jdbcType="INTEGER" />
|
|
|
+ <result column="update_time" property="update_time" jdbcType="DATE" />
|
|
|
+ <result column="pics" property="pics" jdbcType="VARCHAR" />
|
|
|
+ <result column="videos" property="videos" jdbcType="VARCHAR" />
|
|
|
+ <result column="check_item_id" property="check_item_id" jdbcType="INTEGER" />
|
|
|
+ <result column="content" property="content" jdbcType="VARCHAR" />
|
|
|
+ <result column="checkman" property="checkman" jdbcType="VARCHAR" />
|
|
|
+ <result column="checked_person" property="checked_person" jdbcType="INTEGER" />
|
|
|
+ <result column="checked_dept" property="checked_dept" jdbcType="INTEGER" />
|
|
|
+ <result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getAll" resultMap="BaseResultMap" >
|
|
|
- SELECT
|
|
|
- id,username,age,password
|
|
|
- FROM sys_user
|
|
|
+ SELECT *
|
|
|
+ FROM check_score
|
|
|
</select>
|
|
|
|
|
|
<select id="getOne" parameterType="java.lang.Long" resultMap="BaseResultMap" >
|
|
|
- SELECT
|
|
|
- id,username,age,password
|
|
|
- FROM sys_user
|
|
|
+ SELECT *
|
|
|
+ FROM check_score
|
|
|
WHERE id = #{id}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getScoreList" parameterType="java.lang.Long" resultMap="BaseResultMap" >
|
|
|
+ SELECT *
|
|
|
+ FROM check_score
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="checked_person != null">AND checked_person = #{checked_person}</if>
|
|
|
+ <if test="check_item_id != null">AND check_item_id = #{check_item_id}</if>
|
|
|
+ <if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>
|
|
|
+ <if test="start_time != null">AND update_time >= #{start_time}</if>
|
|
|
+ <if test="end_time != null">AND update_time <= #{end_time}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getScoreListByTaskId" parameterType="java.lang.Long" resultMap="BaseResultMap" >
|
|
|
+ SELECT *
|
|
|
+ FROM check_score
|
|
|
+ WHERE task_id = #{task_id}
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="insert" parameterType="com.xintong.visualinspection.bean.User" >
|
|
|
+ <insert id="insert" parameterType="com.xintong.visualinspection.bean.Score" >
|
|
|
INSERT INTO
|
|
|
- sys_user
|
|
|
- (username,age,password,TRUENAME,ORGANID,BIRTH,AGE,MOBILE,POSITIONID,SEX,WORKNO,IDNO)
|
|
|
+ check_score
|
|
|
+ (task_id,update_time,pics,videos,check_item_id,content,checkman,checked_person,checked_dept,emark)
|
|
|
VALUES
|
|
|
- (#{username}, #{age},#{password},#{truename},#{deptId},#{birth},#{age},#{mobile},#{positionId},#{sex},#{workno},#{idno})
|
|
|
+ (#{task_id}, #{update_time},#{pics},#{videos},#{check_item_id},#{content},#{checkman},#{checked_person},#{checked_dept},#{remark})
|
|
|
</insert>
|
|
|
|
|
|
- <update id="update" parameterType="com.xintong.visualinspection.bean.User" >
|
|
|
+ <update id="update" parameterType="com.xintong.visualinspection.bean.Score" >
|
|
|
UPDATE
|
|
|
- sys_user
|
|
|
+ check_score
|
|
|
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="update_time != null">update_time = #{update_time},</if>
|
|
|
+ <if test="pics != null">pics = #{pics},</if>
|
|
|
+ <if test="videos != null">videos = #{videos},</if>
|
|
|
+ <if test="checkman != null">checkman = #{checkman},</if>
|
|
|
+ <if test="checked_person != null">checked_person = #{checked_person},</if>
|
|
|
+ remark=#{remark}
|
|
|
WHERE
|
|
|
id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="delete" parameterType="java.lang.Long" >
|
|
|
DELETE FROM
|
|
|
- sys_user
|
|
|
+ check_score
|
|
|
WHERE
|
|
|
id =#{id}
|
|
|
</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>
|