|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?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.iformall.mapper.WxCUserBasicChildMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserBasicChild">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="sex" jdbcType="INTEGER" property="sex" />
- <result column="nick_name" jdbcType="VARCHAR" property="nickName" />
- <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="remark" jdbcType="VARCHAR" property="remark" />
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`c_user_id`,`name`,`nick_name`,`birthdate`,`sex`,`remark`,`create_date`,`update_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where del_status = 0
- <if test=" null != id ">
- and `id` = #{id}
- </if>
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != cUserId ">
- and `c_user_id` = #{cUserId}
- </if>
- <if test=" null != name ">
- and `name` like concat('%', #{name},'%')
- </if>
- <if test=" null != nickName ">
- and `nick_name` like concat('%', #{nickName},'%')
- </if>
- <if test=" null != sex ">
- and `sex` = #{sex}
- </if>
-
- <if test=" null != startTime ">
- and create_date >= #{startTime}
- </if>
- <if test=" null != endTime">
- and create_date <= #{endTime}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicChild" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_c_user_basic_child
- <include refid="dynamicWhereConditions" />
- </select>
-
- <update id="updDelById" parameterType="com.iformall.domain.po.WxCUserBasicChild">
- update wx_c_user_basic_child set del_status = 1 where id = #{id} and tenant_id = #{tenantId}
- </update>
-
-
- <delete id="deleteByUserBasicId" parameterType="com.iformall.domain.po.WxCUserBasicChild">
- delete from wx_c_user_basic_child where c_user_id = #{cUserId} and tenant_id = #{tenantId}
- </delete>
-
- </mapper>
|