33 lines
1.3 KiB
XML
33 lines
1.3 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.bonus.base.mapper.TbUserPostMapper">
|
|
|
|
<select id="queryByPage" resultType="com.bonus.base.domain.TbUserPost">
|
|
select
|
|
id as id, post_name as postName, rel_name as relName, rel_phone as relPhone, create_time as createTime, pro_id as proId
|
|
from tb_user_post
|
|
<where>
|
|
<if test="proId != null and proId != ''">
|
|
and pro_id = #{proId}
|
|
</if>
|
|
<if test="createTime != null and createTime != ''">
|
|
and create_time = #{createTime}
|
|
</if>
|
|
<if test="postName != null and postName != ''">
|
|
and post_name like concat('%',#{postName},'%')
|
|
</if>
|
|
<if test="relName != null and relName != ''">
|
|
and rel_name like concat('%',#{relName},'%')
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<!--新增所有列-->
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
insert into tb_user_post(post_name, rel_name, rel_phone, create_time, pro_id)
|
|
values (#{postName}, #{relName}, #{relPhone}, #{createTime}, #{proId})
|
|
</insert>
|
|
|
|
</mapper>
|
|
|