123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?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.system.mapper.crm.TCustomerMapper">
-
- <resultMap type="TCustomer" id="TCustomerResult">
- <result property="id" column="id" />
- <result property="companyName" column="company_name" />
- <result property="companyWhere" column="company_where" />
- <result property="companyEnterprisepro" column="company_enterprisepro" />
- <result property="companyState" column="company_state" />
- <result property="companyCapital" column="company_capital" />
- <result property="companySales" column="company_sales" />
- <result property="userName" column="user_name" />
- <result property="userPhone" column="user_phone" />
- <result property="userDepartment" column="user_department" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- </resultMap>
- <sql id="selectTCustomerVo">
- select id, company_name, company_where, company_enterprisepro, company_state, company_capital, company_sales, user_name, user_phone, user_department, create_by, create_time from t_customer
- </sql>
- <select id="selectTCustomerList" parameterType="TCustomer" resultMap="TCustomerResult">
- <include refid="selectTCustomerVo"/>
- <where>
- <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
- <if test="companyWhere != null and companyWhere != ''"> and company_where = #{companyWhere}</if>
- <if test="companyEnterprisepro != null and companyEnterprisepro != ''"> and company_enterprisepro = #{companyEnterprisepro}</if>
- <if test="companyState != null and companyState != ''"> and company_state = #{companyState}</if>
- <if test="companyCapital != null and companyCapital != ''"> and company_capital = #{companyCapital}</if>
- <if test="companySales != null and companySales != ''"> and company_sales = #{companySales}</if>
- <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
- <if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
- <if test="userDepartment != null and userDepartment != ''"> and user_department = #{userDepartment}</if>
- <if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
- </where>
- </select>
-
- <select id="selectTCustomerById" parameterType="String" resultMap="TCustomerResult">
- <include refid="selectTCustomerVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertTCustomer" parameterType="TCustomer" useGeneratedKeys="true" keyProperty="id">
- insert into t_customer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyName != null">company_name,</if>
- <if test="companyWhere != null">company_where,</if>
- <if test="companyEnterprisepro != null">company_enterprisepro,</if>
- <if test="companyState != null">company_state,</if>
- <if test="companyCapital != null">company_capital,</if>
- <if test="companySales != null">company_sales,</if>
- <if test="userName != null">user_name,</if>
- <if test="userPhone != null">user_phone,</if>
- <if test="userDepartment != null">user_department,</if>
- <if test="createBy != null">create_by,</if>
- create_time,
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="companyName != null">#{companyName},</if>
- <if test="companyWhere != null">#{companyWhere},</if>
- <if test="companyEnterprisepro != null">#{companyEnterprisepro},</if>
- <if test="companyState != null">#{companyState},</if>
- <if test="companyCapital != null">#{companyCapital},</if>
- <if test="companySales != null">#{companySales},</if>
- <if test="userName != null">#{userName},</if>
- <if test="userPhone != null">#{userPhone},</if>
- <if test="userDepartment != null">#{userDepartment},</if>
- <if test="createBy != null">#{createBy},</if>
- sysdate(),
- </trim>
- </insert>
- <update id="updateTCustomer" parameterType="TCustomer">
- update t_customer
- <trim prefix="SET" suffixOverrides=",">
- <if test="companyName != null">company_name = #{companyName},</if>
- <if test="companyWhere != null">company_where = #{companyWhere},</if>
- <if test="companyEnterprisepro != null">company_enterprisepro = #{companyEnterprisepro},</if>
- <if test="companyState != null">company_state = #{companyState},</if>
- <if test="companyCapital != null">company_capital = #{companyCapital},</if>
- <if test="companySales != null">company_sales = #{companySales},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="userPhone != null">user_phone = #{userPhone},</if>
- <if test="userDepartment != null">user_department = #{userDepartment},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTCustomerById" parameterType="String">
- delete from t_customer where id = #{id}
- </delete>
- <delete id="deleteTCustomerByIds" parameterType="String">
- delete from t_customer where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|