GarUserOrderMessageMapper.xml 1.84 KB
<?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.trash.garbage.mapper.GarUserOrderMessageMapper">

    <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarUserOrderMessage">
            <id property="garId" column="gar_id" jdbcType="VARCHAR"/>
            <result property="garContent" column="gar_content" jdbcType="VARCHAR"/>
            <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
            <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
            <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
            <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
            <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
            <result property="garUserId" column="gar_user_id" jdbcType="VARCHAR"/>
            <result property="garUserTel" column="gar_user_tel" jdbcType="VARCHAR"/>
            <result property="garMessageState" column="gar_message_state" jdbcType="TINYINT"/>
    </resultMap>

    <sql id="Base_Column_List">
        gar_id,gar_content,gar_create_time,gar_user_id,
        gar_update_time,gar_create_by,gar_update_by,
        gar_remark,gar_user_tel,gar_message_state
    </sql>
    <select id="queryMessageListByUserIdWithState"
            resultType="com.trash.garbage.pojo.vo.GarUserOrderMessageVo">
        select gar_id,gar_content,gar_user_tel
        from gar_user_order_message
        <where>
            <if test="userId != null">
                and gar_user_id = #{userId}
            </if>
            <if test="userId != null">
                and gar_message_state = #{status}
            </if>
        </where>

    </select>
</mapper>