|
@@ -1,68 +1,59 @@
|
|
|
<?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.CheckItemDao" >
|
|
<mapper namespace="com.xintong.visualinspection.dao.master.CheckItemDao" >
|
|
|
- <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.User" >
|
|
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.CheckItem" >
|
|
|
<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" />
|
|
|
|
|
- </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="parent_id" property="parent_id" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="content" property="content" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="score" property="score" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="score_type" property="score_type" jdbcType="INTEGER" />
|
|
|
|
|
+ <result column="type" property="type" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="getAll" resultMap="BaseResultMap" >
|
|
<select id="getAll" resultMap="BaseResultMap" >
|
|
|
- SELECT
|
|
|
|
|
- id,username,age,password
|
|
|
|
|
- FROM sys_user
|
|
|
|
|
|
|
+ SELECT *
|
|
|
|
|
+ FROM check_item
|
|
|
</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_item
|
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
- <insert id="insert" parameterType="com.xintong.visualinspection.bean.User" >
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="getByParentId" parameterType="java.lang.Long" resultMap="BaseResultMap" >
|
|
|
|
|
+ SELECT *
|
|
|
|
|
+ FROM check_item
|
|
|
|
|
+ WHERE parent_id = #{parent_id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insert" parameterType="com.xintong.visualinspection.dao.master.CheckItemDao" >
|
|
|
INSERT INTO
|
|
INSERT INTO
|
|
|
- sys_user
|
|
|
|
|
- (username,age,password,TRUENAME,ORGANID,BIRTH,AGE,MOBILE,POSITIONID,SEX,WORKNO,IDNO)
|
|
|
|
|
|
|
+ check_item
|
|
|
|
|
+ (name,parent_id,content,score,score_type,type)
|
|
|
VALUES
|
|
VALUES
|
|
|
- (#{username}, #{age},#{password},#{truename},#{deptId},#{birth},#{age},#{mobile},#{positionId},#{sex},#{workno},#{idno})
|
|
|
|
|
|
|
+ (#{name}, #{parent_id},#{content},#{score},#{score_type},#{type})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
- <update id="update" parameterType="com.xintong.visualinspection.bean.User" >
|
|
|
|
|
|
|
+ <update id="update" parameterType="com.xintong.visualinspection.dao.master.CheckItemDao" >
|
|
|
UPDATE
|
|
UPDATE
|
|
|
- sys_user
|
|
|
|
|
|
|
+ check_item
|
|
|
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="parent_id != null">parent_id = #{parent_id},</if>
|
|
|
|
|
+ <if test="content != null">content = #{content},</if>
|
|
|
|
|
+ <if test="score != null">score = #{score},</if>
|
|
|
|
|
+ <if test="score_type != null">score_type = #{score_type},</if>
|
|
|
|
|
+ <if test="type != null">type = #{type}</if>
|
|
|
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_item
|
|
|
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>
|