<?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.newfiber.termite.mapper.ProjectUserMapper"> <!-- 通用查询映射结果 --> <resultMap type="com.newfiber.termite.domain.ProjectUser" id="ProjectUserResult"> <result property="id" column="id"/> <result property="projectCode" column="project_code"/> <result property="projectName" column="project_name"/> <result property="userId" column="user_id"/> <result property="remark" column="remark"/> <result property="status" column="status"/> <result property="delFlag" column="del_flag"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> t.id , t.project_code , t.project_name , t.user_id , t.remark , t.status , t.del_flag , t.create_by , t.create_time , t.update_by , t.update_time </sql> <sql id="Where_Condition"> <if test="request.projectCode != null and request.projectCode != ''"> and t.project_code = #{request.projectCode} </if> <if test="request.projectName != null and request.projectName != ''"> and t.project_name = #{request.projectName} </if> <if test="request.userId != null and request.userId != ''"> and t.user_id = #{request.userId} </if> <if test="request.status != null and request.status != ''"> and t.status = #{request.status} </if> </sql> <sql id="Join_Table"> </sql> <select id="selectByCondition" resultMap="ProjectUserResult"> select <include refid="Base_Column_List"/> from ter_project_user t <include refid="Join_Table"/> where t.del_flag = 0 <include refid="Where_Condition"/> order by t.${request.orderBy} </select> <select id="selectOneById" resultMap="ProjectUserResult"> select <include refid="Base_Column_List"/> from ter_project_user t <include refid="Join_Table"/> where t.id = #{id} and t.del_flag = 0 </select> <delete id="deleteBatch"> delete from ter_project_user where 1 = 1 <if test="request.projectCode != null and request.projectCode != ''"> and project_code = #{request.projectCode} </if> </delete> </mapper>