<?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.boco.nbd.wios.manage.mapper.def.AccountMapperEx" > <resultMap id="BaseResultMap" type="com.boco.nbd.wios.manage.entity.bo.Account" > <!-- WARNING - @mbggenerated This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Mon May 18 18:39:09 CST 2020. --> <id column="id" property="id" jdbcType="INTEGER" /> <result column="account" property="account" jdbcType="VARCHAR" /> <result column="password" property="password" jdbcType="VARCHAR" /> <result column="name" property="name" jdbcType="VARCHAR" /> <result column="phone" property="phone" jdbcType="VARCHAR" /> <result column="job_number" property="jobNumber" jdbcType="VARCHAR" /> <result column="email" property="email" jdbcType="VARCHAR" /> <result column="user_id" property="userId" jdbcType="VARCHAR" /> <result column="status" property="status" jdbcType="INTEGER" /> <result column="virtual_balance" property="virtualBalance" jdbcType="DECIMAL" /> <result column="power" property="power" jdbcType="DECIMAL" /> <result column="charge_electric" property="chargeElectric" jdbcType="DECIMAL" /> <result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP" /> <result column="create_account_id" property="createAccountId" jdbcType="INTEGER" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> </resultMap> <sql id="Example_Where_Clause" > <!-- WARNING - @mbggenerated This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Mon May 18 18:39:09 CST 2020. --> <where > <foreach collection="oredCriteria" item="criteria" separator="or" > <if test="criteria.valid" > <trim prefix="(" suffix=")" prefixOverrides="and" > <foreach collection="criteria.criteria" item="criterion" > <choose > <when test="criterion.noValue" > and ${criterion.condition} </when> <when test="criterion.singleValue" > and ${criterion.condition} #{criterion.value} </when> <when test="criterion.betweenValue" > and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when> <when test="criterion.listValue" > and ${criterion.condition} <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," > #{listItem} </foreach> </when> </choose> </foreach> </trim> </if> </foreach> </where> </sql> <sql id="Base_Column_List" > id, account, password, name, phone, job_number, email, user_id , status, virtual_balance, power, charge_electric, last_login_time, create_account_id, create_time, update_time </sql> <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Integer" > select <include refid="Base_Column_List" /> from wb_account where id = #{id,jdbcType=INTEGER} for update </select> <select id="getListForOem" parameterType="com.boco.nbd.wios.manage.entity.bo.AccountBo" resultType="com.boco.nbd.wios.manage.entity.bo.AccountVo"> select t.*,o.name as oemName,o.id as oemId from wb_account t inner join t_oem o on t.id=o.wb_account_id <where> <if test="phone != null and account !=''"> and t.phone = #{phone} </if> <if test="oemId != null"> and o.id = #{oemId} </if> <if test="type != null"> and o.type = #{type} </if> </where> </select> <select id="selectByIds" resultType="com.boco.nbd.wios.manage.entity.bo.Account"> select t.* from wb_account t where t.id in <foreach collection="ids" item="item" index="index" open="(" close=")" separator=","> #{item} </foreach> </select> <select id="selectByParentIds" resultType="com.boco.nbd.wios.manage.entity.bo.AccountVo"> select t.*,war.role_id as roleId,wr.name as roleName from wb_account t left join wb_account_role war on war.account_id = t.id left join wb_role wr on wr.id = war.role_id where ( t.parent_id in <foreach collection="parentIds" item="item" index="index" open="(" close=")" separator=","> #{item} </foreach> or t.id in <foreach collection="parentIds" item="item" index="index" open="(" close=")" separator=","> #{item} </foreach> ) <if test="account != null and account !=''"> and t.account = #{account} </if> <if test="name != null and name != ''"> <bind name="nameLike" value="'%' + name + '%'"/> and t.name like #{nameLike} </if> </select> </mapper>