gan/gan-modules/ruoyi-gan/src/main/resources/mapper/app/AppRegisterMapper.xml

145 lines
7.5 KiB
XML

<?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.ruoyi.app.mapper.AppRegisterMapper">
<resultMap type="AppRegister" id="AppRegisterResult">
<result property="id" column="id" />
<result property="phone" column="phone" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
<result property="username" column="username" />
<result property="prove" column="prove" />
<result property="avatarUrl" column="avatar_url" />
<result property="sex" column="sex" />
<result property="address" column="address" />
<result property="schoolId" column="school_id" />
<result property="email" column="email" />
<result property="invitationCode" column="invitation_code" />
<result property="status" column="status" />
</resultMap>
<sql id="selectAppRegisterVo">
select id, phone, create_time, update_time, create_by, updateBy, remark, username, prove, avatar_url, sex, address, school_id, email ,invitation_code ,status from app_register
</sql>
<select id="selectAppRegisterList" parameterType="AppRegister" resultMap="AppRegisterResult">
<include refid="selectAppRegisterVo"/>
<where>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="prove != null and prove != ''"> and prove = #{prove}</if>
<if test="avatarUrl != null and avatarUrl != ''"> and avatar_url = #{avatarUrl}</if>
<if test="sex != null "> and sex = #{sex}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="schoolId != null "> and school_id = #{schoolId}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
</where>
</select>
<select id="selectAppRegisterById" parameterType="Long" resultMap="AppRegisterResult">
<include refid="selectAppRegisterVo"/>
where id = #{id}
</select>
<insert id="insertAppRegister" parameterType="AppRegister" useGeneratedKeys="true" keyProperty="id">
insert into app_register
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="phone != null">phone,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
<if test="username != null">username,</if>
<if test="prove != null">prove,</if>
<if test="avatarUrl != null">avatar_url,</if>
<if test="sex != null">sex,</if>
<if test="address != null">address,</if>
<if test="schoolId != null">school_id,</if>
<if test="email != null">email,</if>
<if test="invitationCode != null">invitation_code,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="phone != null">#{phone},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
<if test="username != null">#{username},</if>
<if test="prove != null">#{prove},</if>
<if test="avatarUrl != null">#{avatarUrl},</if>
<if test="sex != null">#{sex},</if>
<if test="address != null">#{address},</if>
<if test="schoolId != null">#{schoolId},</if>
<if test="email != null">#{email},</if>
<if test="invitationCode != null">#{invitationCode},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateAppRegister" parameterType="AppRegister">
update app_register
<trim prefix="SET" suffixOverrides=",">
<if test="phone != null">phone = #{phone},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="username != null">username = #{username},</if>
<if test="prove != null">prove = #{prove},</if>
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="address != null">address = #{address},</if>
<if test="schoolId != null">school_id = #{schoolId},</if>
<if test="email != null">email = #{email},</if>
<if test="invitationCode != null">invitation_code = #{invitationCode},</if>
<if test="status != null">status = #{status},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppRegisterById" parameterType="Long">
delete from app_register where id = #{id}
</delete>
<delete id="deleteAppRegisterByIds" parameterType="String">
delete from app_register where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectAppRegisterByphone" resultType="com.ruoyi.app.domain.AppRegister">
select * from app_register where phone = #{phoneNumber}
</select>
<update id="updateAppRegisterByPhone">
update app_register
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="username != null">username = #{username},</if>
<if test="prove != null">prove = #{prove},</if>
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="address != null">address = #{address},</if>
<if test="schoolId != null">school_id = #{schoolId},</if>
<if test="email != null">email = #{email},</if>
<if test="invitationCode != null">invitation_code = #{invitationCode},</if>
status = 0,
</trim>
where phone = #{phone}
</update>
</mapper>